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

[google compute] Add License resource #420

Closed
wants to merge 1 commit into from

Conversation

@erjohnso
Copy link
Member

@erjohnso erjohnso commented Dec 19, 2014

Adds Licenses[1] support to the GCE driver to further improve full API coverage.

[1] https://cloud.google.com/compute/docs/reference/latest/licenses

self.name = name
self.driver = driver
self.charges_use_fee = charges_use_fee
self.extra = extra

This comment has been minimized.

@Kami

Kami Dec 19, 2014
Member

extra = extra or {}

selfLink_parts = license.split('/')
license_project = selfLink_parts[6]
license_name = selfLink_parts[-1]
extra['licenses'].append(self.ex_get_license(license_project,

This comment has been minimized.

@Kami

Kami Dec 19, 2014
Member

To make code easier to read, follow and update, please prefer using keyword arguments over regular arguments.

@@ -4336,7 +4380,13 @@ def _to_snapshot(self, snapshot):
if 'storageBytesStatus' in snapshot:
extra['storageBytesStatus'] = snapshot['storageBytesStatus']
if 'licenses' in snapshot:
extra['licenses'] = snapshot['licenses']
extra['licenses'] = []
for license in snapshot['licenses']:

This comment has been minimized.

@Kami

Kami Dec 19, 2014
Member

Looks like this chunk of code is repeated in two place, might be worth refactoring it in a re-usable method :)

@erjohnso erjohnso force-pushed the erjohnso:GCE_Licenses branch from 3ca4fe9 to 0fa5a48 Dec 21, 2014
@erjohnso
Copy link
Member Author

@erjohnso erjohnso commented Dec 21, 2014

Thanks @Kami. Addressed your feedback on this, so I'll go ahead and do the merge upstream once Travis gives the OK.

@asfgit asfgit closed this in 0486f77 Dec 21, 2014
@erjohnso erjohnso deleted the erjohnso:GCE_Licenses branch Jan 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants