-
Notifications
You must be signed in to change notification settings - Fork 929
LIBCLOUD 473 Add EBS Volume Attributes #210
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
LIBCLOUD 473 Add EBS Volume Attributes #210
Conversation
Synchronizing branch
…ub.com/DivvyCloud/libcloud into LIBCLOUD-473_Add_EBS_Volume_Attributes
|
||
# Set our name if the Name key/value if available | ||
# If we don't get anything back then use the volume id | ||
name = tags.get('Name', volId) |
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.
This now shadows name
argument which is passed to this function.
Maybe a better approach would be to use name
argument which is passed to the function (if available), otherwise fall back to retrieving a name from the tags (`name = name if name else tags.get('Name', volId)).
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.
While you are at it, I would also do the following changes:
- Modify
_to_volume
method signature and defaultname
toNone
- Modify
self._to_volume(el,``)
call to omit name argument (empty string) all together - Add a docstring which explains that if not provided, name is obtained from the tags (if available)
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.
Not a problem, will do.
…ctionary Changed _to_volume to default name to None Updated the extra_attributes_map to cast_func and removed an unnecessary if condition
Assuming that you're okay with these changes I will create a new branch later today to convert all extra_attributes_map dictionaries from type -> cast_func to remain consistent and also will set up the new utility function that we previously discussed. Thanks! |
@cderamus Yeah, sounds good. I've squashed the commits, updated the docstring and merged patch into trunk. Thanks! |
https://issues.apache.org/jira/browse/LIBCLOUD-473