You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by er...@apache.org on 2016/04/30 15:59:08 UTC

libcloud git commit: [google compute] fix missing pricing data

Repository: libcloud
Updated Branches:
  refs/heads/trunk a2682566b -> f5537811d


[google compute] fix missing pricing data

Closes LIBCLOUD-713
Closes #778

Signed-off-by: Eric Johnson <er...@google.com>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f5537811
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f5537811
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f5537811

Branch: refs/heads/trunk
Commit: f5537811d97a7b58a1222a2f43dfccfa6add3bc6
Parents: a268256
Author: Eric Johnson <er...@google.com>
Authored: Sat Apr 30 13:47:01 2016 +0000
Committer: Eric Johnson <er...@google.com>
Committed: Sat Apr 30 13:57:34 2016 +0000

----------------------------------------------------------------------
 CHANGES.rst                     | 8 ++++++++
 libcloud/compute/drivers/gce.py | 6 +++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f5537811/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 4c15b32..55e914a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -24,6 +24,14 @@ General
 Compute
 ~~~~~~~
 
+- Fix missing pricing data for GCE
+  (LIBCLOUD-713, GITHUB-779)
+  [Eric Johnson]
+
+- Add Image Family support for GCE
+  (GITHUB-778)
+  [Rick Wright]
+
 - Fix a race condition on GCE driver `list_nodes()`- Invoking GCE’s
   `list_nodes()` while some VMs are being shutdown can result in the following
   `libcloud.common.google.ResourceNotFoundError` exception to be raised.

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f5537811/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 2538a4d..371e91d 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -5529,8 +5529,12 @@ class GCENodeDriver(NodeDriver):
         extra['guestCpus'] = machine_type.get('guestCpus')
         extra['creationTimestamp'] = machine_type.get('creationTimestamp')
         try:
+            orig_api_name = self.api_name
+            self.api_name = "%s_%s" % (self.api_name,
+                                       extra['zone'].name.split("-")[0])
             price = self._get_size_price(size_id=machine_type['name'])
-        except KeyError:
+            self.api_name = orig_api_name
+        except:
             price = None
 
         return GCENodeSize(id=machine_type['id'], name=machine_type['name'],