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/07/02 17:02:49 UTC

[libcloud] branch trunk updated (780d859 -> 5685a7b)

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 780d859  Add changelog entry for #1286.
     new f5ad09c  Use a consistent method name.
     new 5685a7b  Add a test case for new method.

The 2 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:
 libcloud/compute/drivers/gce.py   |  2 +-
 libcloud/test/compute/test_gce.py | 32 ++++++++++++++++++++++++++++++--
 2 files changed, 31 insertions(+), 3 deletions(-)


[libcloud] 01/02: Use a consistent method name.

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 f5ad09c1a82bd48e6821b03b4dcd60bdd492f27d
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Jul 2 19:01:34 2019 +0200

    Use a consistent method name.
---
 libcloud/compute/drivers/gce.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 7da60ea..4614ca8 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -1456,7 +1456,7 @@ class GCEInstanceGroupManager(UuidMixin):
         return self.driver.ex_instancegroup_set_named_ports(
             instancegroup=self.instance_group, named_ports=named_ports)
 
-    def set_autoHealingPolicies(self, healthcheck, initialdelaysec):
+    def set_autohealingpolicies(self, healthcheck, initialdelaysec):
         """
         Sets the autohealing policies for the instance for the instance group
         controlled by this manager.


[libcloud] 02/02: Add a test case for new method.

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 5685a7b0339d7f697cbcdb8f0e8e0a74c956a26b
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Jul 2 19:01:57 2019 +0200

    Add a test case for new method.
---
 libcloud/test/compute/test_gce.py | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py
index 6d6ed1c..b79677f 100644
--- a/libcloud/test/compute/test_gce.py
+++ b/libcloud/test/compute/test_gce.py
@@ -449,6 +449,29 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin):
                           {'name': 'foo',
                            'port': 4444})
 
+    def test_ex_instancegroupmanager_set_autohealing_policies(self):
+        kwargs = {'host': 'lchost',
+                  'path': '/lc',
+                  'port': 8000,
+                  'interval': 10,
+                  'timeout': 10,
+                  'unhealthy_threshold': 4,
+                  'healthy_threshold': 3,
+                  'description': 'test healthcheck'}
+        healthcheck_name = 'lchealthcheck'
+        hc = self.driver.ex_create_healthcheck(healthcheck_name, **kwargs)
+
+        ig_name = 'myinstancegroup'
+        ig_zone = 'us-central1-a'
+        manager = self.driver.ex_get_instancegroupmanager(ig_name, ig_zone)
+
+        res = self.driver.ex_instancegroupmanager_set_autohealingpolicies(
+            manager=manager, healthcheck=hc, initialdelaysec=2)
+        self.assertTrue(res)
+
+        res = manager.set_autohealingpolicies(healthcheck=hc, initialdelaysec=2)
+        self.assertTrue(res)
+
     def test_ex_create_instancegroupmanager(self):
         name = 'myinstancegroup'
         zone = 'us-central1-a'
@@ -3567,8 +3590,13 @@ class GCEMockHttp(MockHttp):
 
     def _zones_us_central1_a_instanceGroupManagers_myinstancegroup(
             self, method, url, body, headers):
-        body = self.fixtures.load(
-            'zones_us-central1-a_instanceGroupManagers_myinstancegroup.json')
+        if method == 'PATCH':
+            # test_ex_instancegroupmanager_set_autohealing_policies
+            body = self.fixtures.load(
+                'zones_us-central1-a_operations_operation_zones_us-central1-a_instanceGroupManagers_insert_post.json')
+        else:
+            body = self.fixtures.load(
+                'zones_us-central1-a_instanceGroupManagers_myinstancegroup.json')
         return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
 
     def _zones_us_central1_a_instanceGroupManagers_myinstancegroup_shared_network(