]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Add support for force-delete backups
authorwanghao <wanghao749@huawei.com>
Fri, 20 Mar 2015 07:51:57 +0000 (15:51 +0800)
committerJohn Griffith <john.griffith8@gmail.com>
Fri, 10 Jul 2015 21:38:53 +0000 (21:38 +0000)
commit1c91180de97135266b8d55e827bf0075eded8e5f
tree561ebb011f4bac649ea7cde4674c8176b0a5bc78
parent0f588ac59b998a8a12457ffdca87292d67a0584a
Add support for force-delete backups

1. Add _get and _delete method to BackupAdminController.
2. Add force=False arg to delete method in backup api.
3. If force=True, then allow the deletion of backup, which
can be in any state.
4. For chunkeddriver based backup, check the status of backup
from DB in backup loop, if it has changed to deleting, set the
flag is_backup_canceled and clear the data to avoid leaving orphan
object in the object store.
5. Add the flag: support_force_delete=False in BackupDriver. That
indicates if the backup driver supports force deletion.
It should be set to True if the driver that inherits from BackupDriver
supports the force deletion function.
6. If the backup driver doesn't support this feature, and it will return
405 when calling API of force delete.

DocImpact
APIImpact
Add os-force_delete in request body:
*POST /v2/{tenant_id}/backups/{id}/action
{
  "os-force_delete": {}
}
Implements: blueprint support-force-delete-backup

Change-Id: Ia4d36520d2a092730cd1be56e338349e383f9e6b
13 files changed:
cinder/api/contrib/admin_actions.py
cinder/api/contrib/backups.py
cinder/backup/api.py
cinder/backup/chunkeddriver.py
cinder/backup/driver.py
cinder/backup/manager.py
cinder/backup/rpcapi.py
cinder/exception.py
cinder/tests/unit/api/contrib/test_admin_actions.py
cinder/tests/unit/api/contrib/test_backups.py
cinder/tests/unit/policy.json
cinder/tests/unit/test_backup.py
etc/cinder/policy.json