-
Notifications
You must be signed in to change notification settings - Fork 926
[LIBCLOUD-758] Standardize volumesnapshot state #602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -236,15 +236,27 @@ class StorageVolumeState(object): | |
| """ | ||
| Standard states of a StorageVolume | ||
| """ | ||
| AVAILABLE = "available" | ||
| ERROR = "error" | ||
| INUSE = "in_use" | ||
| CREATING = "creating" | ||
| DELETING = "deleting" | ||
| DELETED = "deleted" | ||
| BACKUP = "backup" | ||
| ATTACHING = "attaching" | ||
| UNKNOWN = "unknown" | ||
|
|
||
|
|
||
| class VolumeSnapshotState(object): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In newer parts of the code we decided to replace numeric enum values with string values (e.g. RecordType enum). Strings makes it easier to see what's going on since you don't need to check the enum type definition to see to which enum name a particular value maps to. I would appreciate if you can update the code to use string values (e.g. AVAILABLE = 'available', ERROR = ' error', etc.). In the future I also plan to clean and improve the legacy code and update |
||
| """ | ||
| Standard states of VolumeSnapshots | ||
| """ | ||
| AVAILABLE = 0 | ||
| ERROR = 1 | ||
| INUSE = 2 | ||
| CREATING = 3 | ||
| DELETING = 4 | ||
| DELETED = 5 | ||
| BACKUP = 6 | ||
| ATTACHING = 7 | ||
| UNKNOWN = 8 | ||
| CREATING = 2 | ||
| DELETING = 3 | ||
| RESTORING = 4 | ||
| UNKNOWN = 5 | ||
|
|
||
|
|
||
| class Architecture(object): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, for a late comment, I missed this in the previous pass.
For consistency, it would be great if you can change "INUSE" to "IN_USE" and "BACKUP" to "SNAPSHOTING" (this way it's a verb and it's consistent with other states).
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but I personally find "backup" state a bit confusing (backuping is also better, imo, but snapshotting is more provider agnostic) :)