Skip to content

Commit ce1a668

Browse files
author
abdul
committed
mbs client: Proper passing of parameters
1 parent 3be2859 commit ce1a668

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

mbs_client/client.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,18 @@ def stop_backup_system(self):
5757

5858
###########################################################################
5959
def get_backup_database_names(self, backup_id):
60-
return self._execute_command("get-backup-database-names?backupId=%s" %
61-
backup_id)
60+
params = {
61+
"backupId": backup_id
62+
}
63+
return self._execute_command("get-backup-database-names",
64+
params=params)
6265

6366
###########################################################################
6467
def delete_backup(self, backup_id):
65-
return self._execute_command("delete-backup?backupId=%s" % backup_id)
68+
params = {
69+
"backupId": backup_id
70+
}
71+
return self._execute_command("delete-backup", params=params)
6672

6773
###########################################################################
6874
def restore_backup(self, backup_id, destination_uri,
@@ -105,8 +111,12 @@ def _command_url(self, command, params=None):
105111

106112
if params:
107113
url += "?"
108-
for name,val in params.items():
114+
count = 0
115+
for name, val in params.items():
116+
if count > 0:
117+
url += "&"
109118
url += "%s=%s" % (name, val)
119+
count += 1
110120
return url
111121

112122
###########################################################################

0 commit comments

Comments
 (0)