Add VolumeSnapshot.created attribute#473
Conversation
There was a problem hiding this comment.
Added to aid introspection in all sorts of IDEs and ipython.
There was a problem hiding this comment.
The behavior is not exactly the same. Previously those variables were only instance variables, now they are also class variables which could have undesired consequences in some cases (https://stackoverflow.com/questions/207000/python-difference-between-class-and-instance-attributes).
I would prefer to keep it as it was. As far as introspection goes -I need to dig into it, but at least as far as helping with types go - you can help IDE's by adding type asserts and docstring annotation (we already do the latter in most places).
There was a problem hiding this comment.
|
There was a problem hiding this comment.
To aid introspection in PyCharm.
23bace9 to
1ddf58f
Compare
1ddf58f to
ad31155
Compare
|
Besides the class variables change, this PR looks good to me. |
|
Removed instance variables and merged trunk into the branch. |
One very important aspect of snapshots is when they are made, especially when used as historical backups. The field in VolumeSnapshot.extra that is used to represent this data varies between OS, EC2, GCE and Rackspace. Also, EC2 boasts a
datetimevalue inextra, while OpenStack and derivatives use a plain string.This PR adds a
createdattribute to VolumeSnapshot, that is a parsed date. This unified all implementations.