diff options
author | Denis Makogon <dmakogon@mirantis.com> | 2014-10-22 16:42:47 +0300 |
---|---|---|
committer | Denis Makogon <dmakogon@mirantis.com> | 2015-01-29 18:18:43 +0200 |
commit | 451c4748fa07332f32ce9dc9f887b2c36d4c834c (patch) | |
tree | d9906308a327367ea394cbbbf323a8bb04163e45 /trove/backup | |
parent | e06bb53064d5c4531253da4277ffe1fc12a8242a (diff) | |
download | trove-451c4748fa07332f32ce9dc9f887b2c36d4c834c.tar.gz |
Fix backup state check while restoring an instance
Reasons:
- Trove API service checks backup only for NEW/BUILDING state,
FAILED state also significant since users are not able to
restore an instance from FAILED backup.
Changes:
- adding 'is_done_successfuly' property to DBBackup object;
- adding status validation at restoring;
- fake int-tests proposed.
Behaviour:
- server side raises HTTP Conflict(409) when attempting
to restore an instance from backup that is still running or failed.
Change-Id: Ide9d0e6f67adaea0c6d99679eba73cebb01c807f
Closes-Bug: #1338996
Diffstat (limited to 'trove/backup')
-rw-r--r-- | trove/backup/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/trove/backup/models.py b/trove/backup/models.py index 979103ca..a67add0f 100644 --- a/trove/backup/models.py +++ b/trove/backup/models.py @@ -275,6 +275,10 @@ class DBBackup(DatabaseModelBase): return self.state in BackupState.END_STATES @property + def is_done_successfuly(self): + return self.state == BackupState.COMPLETED + + @property def filename(self): if self.location: last_slash = self.location.rfind("/") |