Skip to content

Commit

Permalink
GCE: Add missing snapshot attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien Goasguen <runseb@gmail.com>

This closes apache#401
  • Loading branch information
erjohnso committed Dec 1, 2014
1 parent 2f5be7f commit 0f99017
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Compute
(GITHUB-390, GITHUB-394)
[Eric Johnson]

- GCE: Add missing snapshot attributes.
(GITHUB-401)
[Eric Johnson]

Changes with Apache Libcloud 0.16.0
-----------------------------------

Expand Down
10 changes: 10 additions & 0 deletions libcloud/compute/drivers/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -3837,6 +3837,16 @@ def _to_snapshot(self, snapshot):
extra['selfLink'] = snapshot.get('selfLink')
extra['creationTimestamp'] = snapshot.get('creationTimestamp')
extra['sourceDisk'] = snapshot.get('sourceDisk')
if 'description' in snapshot:
extra['description'] = snapshot['description']
if 'sourceDiskId' in snapshot:
extra['sourceDiskId'] = snapshot['sourceDiskId']
if 'storageBytes' in snapshot:
extra['storageBytes'] = snapshot['storageBytes']
if 'storageBytesStatus' in snapshot:
extra['storageBytesStatus'] = snapshot['storageBytesStatus']
if 'licenses' in snapshot:
extra['licenses'] = snapshot['licenses']

return GCESnapshot(id=snapshot['id'], name=snapshot['name'],
size=snapshot['diskSizeGb'],
Expand Down

0 comments on commit 0f99017

Please sign in to comment.