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/10/08 21:02:50 UTC

[libcloud] branch trunk updated (7a97372 -> 863f171)

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 7a97372  Add changelog entry.
     new 947e558  Upgrade pytest to the latest stable version which still works with Python 2.
     add d5c69ea  [Bug fix] Arguments are not passed correctly to the method, causing gce driver to return an error when setting metadata into a GCE project. Error: - ValueError: Unsupported metadata format. Solution: - Removed unnecessary "self" argument to ex_set_common_instance_metadata and included force argument, which was currently missing.
     new 5e54fee  Merge branch 'bug-fix-gce-cannot-set-metadata-values' of https://github.com/aitorzabala/libcloud into aitorzabala-bug-fix-gce-cannot-set-metadata-values
     new 87247f3  Also fix GCEProject.set_usage_export_bucket method and use keyword arguments to be on the safe side.
     new 863f171  Add changelog entry.

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                       |  4 ++++
 libcloud/compute/drivers/gce.py   |  6 ++++--
 libcloud/test/compute/test_gce.py | 11 ++++++++++-
 requirements-tests.txt            |  2 +-
 4 files changed, 19 insertions(+), 4 deletions(-)


[libcloud] 02/04: Merge branch 'bug-fix-gce-cannot-set-metadata-values' of https://github.com/aitorzabala/libcloud into aitorzabala-bug-fix-gce-cannot-set-metadata-values

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 5e54fee4b5588274f2e873d6a5a6cb0710d657d7
Merge: 947e558 d5c69ea
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Oct 8 22:56:03 2019 +0200

    Merge branch 'bug-fix-gce-cannot-set-metadata-values' of https://github.com/aitorzabala/libcloud into aitorzabala-bug-fix-gce-cannot-set-metadata-values

 libcloud/compute/drivers/gce.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[libcloud] 01/04: Upgrade pytest to the latest stable version which still works with Python 2.

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 947e55835027ac6a6b17a0c279fca8b13b31e1f6
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Oct 8 22:51:19 2019 +0200

    Upgrade pytest to the latest stable version which still works with
    Python 2.
---
 requirements-tests.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements-tests.txt b/requirements-tests.txt
index 040d1a0..d20be44 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -7,5 +7,5 @@ codecov
 coverage<4.0
 requests
 requests_mock
-pytest>=3.4,<3.5
+pytest==4.6.5
 cryptography==2.6.1


[libcloud] 03/04: Also fix GCEProject.set_usage_export_bucket method and use keyword arguments to be on the safe side.

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 87247f31aeb43f30981ead86be2022a5ede17905
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Oct 8 22:58:40 2019 +0200

    Also fix GCEProject.set_usage_export_bucket method and use keyword
    arguments to be on the safe side.
    
    Add test cases.
---
 libcloud/compute/drivers/gce.py   |  6 ++++--
 libcloud/test/compute/test_gce.py | 11 ++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 1b1a0e8..889fd88 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -899,7 +899,8 @@ class GCEProject(UuidMixin):
         :return: True if successful
         :rtype:  ``bool``
         """
-        return self.driver.ex_set_common_instance_metadata(metadata, force)
+        return self.driver.ex_set_common_instance_metadata(metadata=metadata,
+                                                           force=force)
 
     def set_usage_export_bucket(self, bucket, prefix=None):
         """
@@ -921,7 +922,8 @@ class GCEProject(UuidMixin):
         :return: True if successful
         :rtype:  ``bool``
         """
-        return self.driver.ex_set_usage_export_bucket(self, bucket, prefix)
+        return self.driver.ex_set_usage_export_bucket(bucket=bucket,
+                                                      prefix=prefix)
 
     def __repr__(self):
         return '<GCEProject id="%s" name="%s">' % (self.id, self.name)
diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py
index 39b9a96..27ce370 100644
--- a/libcloud/test/compute/test_gce.py
+++ b/libcloud/test/compute/test_gce.py
@@ -26,7 +26,7 @@ from libcloud.compute.drivers.gce import (
     GCENodeDriver, API_VERSION, timestamp_to_datetime, GCEAddress, GCEBackend,
     GCEBackendService, GCEFirewall, GCEForwardingRule, GCEHealthCheck,
     GCENetwork, GCENodeImage, GCERoute, GCERegion, GCETargetHttpProxy,
-    GCEUrlMap, GCEZone, GCESubnetwork)
+    GCEUrlMap, GCEZone, GCESubnetwork, GCEProject)
 from libcloud.common.google import (GoogleBaseAuthConnection,
                                     ResourceNotFoundError, ResourceExistsError,
                                     GoogleBaseError)
@@ -1977,6 +1977,10 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin):
         bucket_name = 'https://www.googleapis.com/foo'
         self.driver.ex_set_usage_export_bucket(bucket_name)
 
+        project = GCEProject(id=None, name=None, metadata=None, quotas=None,
+                             driver=self.driver)
+        project.set_usage_export_bucket(bucket=bucket_name)
+
     def test__set_project_metadata(self):
         self.assertEqual(
             len(self.driver._set_project_metadata(None, False, "")), 0)
@@ -2059,6 +2063,11 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin):
                                                'value': 'v2'}]}
         self.driver.ex_set_common_instance_metadata(gcedict)
 
+        # Verify project notation works
+        project = GCEProject(id=None, name=None, metadata=None, quotas=None,
+                             driver=self.driver)
+        project.set_common_instance_metadata(metadata=gcedict)
+
     def test_ex_set_node_metadata(self):
         node = self.driver.ex_get_node('node-name', 'us-central1-a')
         # test non-dict


[libcloud] 04/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 863f17148357b426c4e7cfd8857f1c5f53944362
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Oct 8 23:00:57 2019 +0200

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

diff --git a/CHANGES.rst b/CHANGES.rst
index 0241c26..32e127d 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -10,6 +10,10 @@ Compute
 - [Packet] Update ``list_sizes`` method so it accepts ``ex_project_id`` argument
   and works with project API tokens. (GITHUB-1351) [Dimitris Moraitis - @d-mo]
 
+- [GCE] Fix ``GCEProject.set_common_instance_metadata`` and
+  ``GCEproject.set_usage_export_bucket`` method. (GITHUB-1354)
+  [Aitor Zabala - @aitorzabala, Tomaz Muraus - @Kami]
+
 Storage
 ~~~~~~~