Merge "Fixes the backup-delete"
This commit is contained in:
@@ -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)
|
||||
|
@@ -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>',
|
||||
|
Reference in New Issue
Block a user