Skip to content

Commit 0ca3d37

Browse files
committed
Fixed HTTP auth handling
1 parent 4708538 commit 0ca3d37

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

phpmyadmin_sql_backup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ def download_sql_backup(url, user, password, dry_run=False, overwrite_existing=F
5757
g = grab.Grab(encoding=encoding, timeout=timeout)
5858
if http_auth:
5959
g.setup(userpwd=http_auth)
60+
else:
61+
g.doc.set_input_by_id('input_username', user)
62+
g.doc.set_input_by_id('input_password', password)
63+
g.submit()
6064
g.go(url)
61-
62-
g.doc.set_input_by_id('input_username', user)
63-
g.doc.set_input_by_id('input_password', password)
6465
if server_name:
6566
g.doc.set_input_by_id('input_servername', server_name)
66-
g.submit()
6767

6868
if not is_login_successful(g):
6969
raise ValueError('Could not login - did you provide the correct username / password?')

0 commit comments

Comments
 (0)