You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2019/12/24 19:23:24 UTC

[libcloud] branch trunk updated (46eccd4 -> e7d1293)

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.


    from 46eccd4  Bump version to v2.8.0.
     add 1b0d462  Update available ec2 instance types.
     new 4316f12  Indicate we are now working on 2.9.0-dev.
     new fb9529c  Update "ex_list_instancegroups" method in the GCE driver so it doesn't throw an exception if a response doesn't contain "zone" attribute.
     new facae52  Add changelog entry.
     new e7d1293  Fix changelog formatting.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.rst                                        |   25 +-
 docs/conf.py                                       |    4 +-
 libcloud/__init__.py                               |    2 +-
 libcloud/compute/constants.py                      | 2340 ++++++++++++--------
 libcloud/compute/drivers/gce.py                    |    6 +-
 ...instanceGroups_zone_attribute_not_present.json} |    6 +-
 libcloud/test/compute/test_gce.py                  |   15 +
 7 files changed, 1513 insertions(+), 885 deletions(-)
 copy libcloud/test/compute/fixtures/gce/{zones_us_central1_a_instanceGroups.json => zones_us_central1_a_instanceGroups_zone_attribute_not_present.json} (80%)


[libcloud] 04/04: Fix changelog formatting.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit e7d1293651db05a54955f44551f892c9df57457b
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Dec 24 19:46:51 2019 +0100

    Fix changelog formatting.
---
 CHANGES.rst | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/CHANGES.rst b/CHANGES.rst
index f5e9cd5..4d69d92 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -18,7 +18,7 @@ Changes in Apache Libcloud v2.8.0
 ---------------------------------
 
 Common
-------
+~~~~~~
 
 - Fix a regression with ``get_driver()`` method not working if ``provider``
   argument value was a string (e.g. using ``get_driver('openstack')``
@@ -48,7 +48,7 @@ Common
   [Tomaz Muraus]
 
 Compute
--------
+~~~~~~~
 
 - [DigitalOcean] Fix ``attach_volume`` and ``detach_volume`` methods.
   Previously those two methods incorrectly passed volume id instead of
@@ -105,7 +105,7 @@ Compute
   [Tomaz Muraus]
 
 Storage
--------
+~~~~~~~
 
 - [AWS S3] Make sure ``host`` driver constructor argument has priority
   over ``region`` argument.
@@ -120,14 +120,14 @@ Changes in Apache Libcloud v2.7.0
 ---------------------------------
 
 General
--------
+~~~~~~~
 
 - Test code with Python 3.8 and advertise that we also support Python 3.8.
   (GITHUB-1371, GITHUB-1374)
   [Tomaz Muraus]
 
 Common
-------
+~~~~~~
 
 - [OpenStack] Fix OpenStack project scoped token authentication. The driver
   constructors now accept ``ex_tenant_domain_id`` argument which tells
@@ -136,7 +136,7 @@ Common
   [kshtsk]
 
 Compute
--------
+~~~~~~~
 
 - Introduce type annotations for the base compute API methods. This means you
   can now leverage mypy to type check (with some limitations) your code which


[libcloud] 03/04: Add changelog entry.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit facae521db6ce8459ba55da6b1bed5546f6fe5f9
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Dec 24 19:46:09 2019 +0100

    Add changelog entry.
---
 CHANGES.rst | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/CHANGES.rst b/CHANGES.rst
index 87c97f6..f5e9cd5 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,6 +1,19 @@
 Changelog
 =========
 
+Changes in Apache Libcloud in development
+-----------------------------------------
+
+Compute
+~~~~~~~
+
+- [GCE] Fix ``ex_list_instancegroups`` method so it doesn't throw if ``zone``
+  attribute is not present in the response.
+
+  Reported by Kartik Subbarao (@kartiksubbarao)
+  (GITHUB-1346)
+  [Tomaz Muraus]
+
 Changes in Apache Libcloud v2.8.0
 ---------------------------------
 


[libcloud] 01/04: Indicate we are now working on 2.9.0-dev.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 4316f12de5f65ac402aab343325ca2ccbd490264
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Dec 24 19:38:09 2019 +0100

    Indicate we are now working on 2.9.0-dev.
---
 docs/conf.py         | 4 ++--
 libcloud/__init__.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index 82fcf33..696f176 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -73,9 +73,9 @@ html_show_sphinx = False
 # built documents.
 #
 # The short X.Y version.
-version = '2.8.0'
+version = '2.9.0-dev'
 # The full version, including alpha/beta/rc tags.
-release = '2.8.0'
+release = '2.9.0-dev'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/libcloud/__init__.py b/libcloud/__init__.py
index ae6005d..49cb047 100644
--- a/libcloud/__init__.py
+++ b/libcloud/__init__.py
@@ -46,7 +46,7 @@ __all__ = [
     'enable_debug'
 ]
 
-__version__ = '2.8.0'
+__version__ = '2.9.0-dev'
 
 
 def enable_debug(fo):


[libcloud] 02/04: Update "ex_list_instancegroups" method in the GCE driver so it doesn't throw an exception if a response doesn't contain "zone" attribute.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit fb9529caa0d40d2a1d2c0d19ac37e113dd0a9feb
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Dec 24 19:43:41 2019 +0100

    Update "ex_list_instancegroups" method in the GCE driver so it doesn't
    throw an exception if a response doesn't contain "zone" attribute.
    
    Reported by Kartik Subbarao.
    
    Resolves #1346
---
 libcloud/compute/drivers/gce.py                    |  6 ++++-
 ..._instanceGroups_zone_attribute_not_present.json | 27 ++++++++++++++++++++++
 libcloud/test/compute/test_gce.py                  | 15 ++++++++++++
 3 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 5077653..046854b 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -9223,7 +9223,11 @@ class GCENodeDriver(NodeDriver):
         extra['namedPorts'] = instancegroup.get('namedPorts', [])
         extra['fingerprint'] = instancegroup.get('fingerprint', None)
 
-        zone = self.ex_get_zone(instancegroup['zone'])
+        zone = instancegroup.get('zone', None)
+        if zone:
+            # Apparently zone attribute is not always present, see
+            # https://github.com/apache/libcloud/issues/1346 for details
+            zone = self.ex_get_zone(zone)
 
         # Note: network/subnetwork will not be available if the Instance Group
         # does not contain instances.
diff --git a/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_zone_attribute_not_present.json b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_zone_attribute_not_present.json
new file mode 100644
index 0000000..39c0a80
--- /dev/null
+++ b/libcloud/test/compute/fixtures/gce/zones_us_central1_a_instanceGroups_zone_attribute_not_present.json
@@ -0,0 +1,27 @@
+{
+    "id": "projects/project_name/zones/us-central1-a/instanceGroups",
+    "items": [
+        {
+            "creationTimestamp": "2016-09-09T13:48:39.700-07:00",
+            "description": "",
+            "fingerprint": "42WmSpB8rSM=",
+            "id": "5837905299775594184",
+            "kind": "compute#instanceGroup",
+            "name": "myname",
+            "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname",
+            "size": 0
+        },
+        {
+            "creationTimestamp": "2016-09-09T13:54:30.857-07:00",
+            "description": "",
+            "fingerprint": "42WmSpB8rSM=",
+            "id": "6825641674983513961",
+            "kind": "compute#instanceGroup",
+            "name": "myname2",
+            "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups/myname2",
+            "size": 0
+        }
+    ],
+    "kind": "compute#instanceGroupList",
+    "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/zones/us-central1-a/instanceGroups"
+}
diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py
index 48a545e..d7cc306 100644
--- a/libcloud/test/compute/test_gce.py
+++ b/libcloud/test/compute/test_gce.py
@@ -396,6 +396,14 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin):
         self.assertEqual(actual[0].name, 'myname')
         self.assertEqual(actual[1].name, 'myname2')
 
+    def test_ex_list_instancegroups_zone_attribute_not_present_in_response(self):
+        GCEMockHttp.type = 'zone_attribute_not_present'
+        loc = 'us-central1-a'
+        actual = self.driver.ex_list_instancegroups(loc)
+        self.assertTrue(len(actual) == 2)
+        self.assertEqual(actual[0].name, 'myname')
+        self.assertEqual(actual[1].name, 'myname2')
+
     def test_ex_instancegroup_list_instances(self):
         name = 'myname'
         loc = 'us-central1-a'
@@ -3783,6 +3791,13 @@ class GCEMockHttp(MockHttp):
                 'zones_us_central1_a_instanceGroups.json')
         return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
 
+    def _zones_us_central1_a_instanceGroups_zone_attribute_not_present(self, method, url, body, headers):
+        if method == 'GET':
+            # get or list call
+            body = self.fixtures.load(
+                'zones_us_central1_a_instanceGroups_zone_attribute_not_present.json')
+        return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
+
     def _zones_us_central1_a_operations_operation_zones_us_central1_a_instanceGroups_myname_insert(
             self, method, url, body, headers):
         """ Redirects from _zones_us_central1_a_instanceGroups """