Merge "Fixes the backup-delete"

This commit is contained in:
Jenkins
2015-11-28 18:34:57 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 5 deletions

View File

@@ -69,11 +69,11 @@ class Backups(base.ManagerWithFind):
body['backup']['parent_id'] = parent_id
return self._create("/backups", body, "backup")
def delete(self, backup_id):
def delete(self, backup):
"""Delete the specified backup.
:param backup_id: The backup id to delete
:param backup: The backup to delete
"""
url = "/backups/%s" % backup_id
url = "/backups/%s" % base.getid(backup)
resp, body = self.api.client.delete(url)
common.check_for_exceptions(resp, body, url)

View File

@@ -753,11 +753,12 @@ def do_backup_list(cs, args):
order_by='updated')
@utils.arg('backup', metavar='<backup>', help='ID of the backup.')
@utils.arg('backup', metavar='<backup>', help='ID or name of the backup.')
@utils.service_type('database')
def do_backup_delete(cs, args):
"""Deletes a backup."""
cs.backups.delete(args.backup)
backup = _find_backup(cs, args.backup)
cs.backups.delete(backup)
@utils.arg('instance', metavar='<instance>',