Skip to content
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

Closed
wants to merge 4 commits into from
Closed

LIBCLOUD 473 Add EBS Volume Attributes #210

wants to merge 4 commits into from

Conversation

cderamus
Copy link
Contributor

@cderamus cderamus commented Dec 26, 2013


# 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)
Copy link
Member

@Kami Kami Dec 26, 2013

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)).

Copy link
Member

@Kami Kami Dec 26, 2013

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:

  1. Modify _to_volume method signature and default name to None
  2. Modify self._to_volume(el,``) call to omit name argument (empty string) all together
  3. Add a docstring which explains that if not provided, name is obtained from the tags (if available)

Copy link
Contributor Author

@cderamus cderamus Dec 26, 2013

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
@cderamus
Copy link
Contributor Author

cderamus commented Dec 27, 2013

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!

@Kami
Copy link
Member

Kami commented Dec 27, 2013

@cderamus Yeah, sounds good.

I've squashed the commits, updated the docstring and merged patch into trunk. Thanks!

@cderamus cderamus closed this Dec 27, 2013
@cderamus cderamus deleted the LIBCLOUD-473_Add_EBS_Volume_Attributes branch Dec 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants