libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [40/51] [abbrv] libcloud git commit: added a check for a health monitor in loadbalancer/drivers/nttcis. Without it a loadbalancer pool with no healthchecks will cause an AttributeError.
Date Wed, 31 Oct 2018 03:11:51 GMT
added a check for a health monitor in loadbalancer/drivers/nttcis.  Without it a loadbalancer
pool with no healthchecks will cause an AttributeError.


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

Branch: refs/heads/trunk
Commit: f34d98e7b6635b09d2aea8a64c8079f93d640025
Parents: 65d45f9
Author: mitch <mitch.raful@itaas.dimensiondata.com>
Authored: Thu Oct 25 10:58:20 2018 -0400
Committer: mitch <mitch.raful@itaas.dimensiondata.com>
Committed: Thu Oct 25 10:58:20 2018 -0400

----------------------------------------------------------------------
 libcloud/loadbalancer/base.py           | 1 +
 libcloud/loadbalancer/drivers/nttcis.py | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f34d98e7/libcloud/loadbalancer/base.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/base.py b/libcloud/loadbalancer/base.py
index d3cbfb5..2ad7c07 100644
--- a/libcloud/loadbalancer/base.py
+++ b/libcloud/loadbalancer/base.py
@@ -122,6 +122,7 @@ class Algorithm(object):
     """
     Represents a load balancing algorithm.
     """
+    RANDOM = 0
     ROUND_ROBIN = 1
     LEAST_CONNECTIONS = 2
     WEIGHTED_ROUND_ROBIN = 3

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f34d98e7/libcloud/loadbalancer/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/drivers/nttcis.py b/libcloud/loadbalancer/drivers/nttcis.py
index bd97428..a681055 100644
--- a/libcloud/loadbalancer/drivers/nttcis.py
+++ b/libcloud/loadbalancer/drivers/nttcis.py
@@ -1133,14 +1133,18 @@ class NttCisLBDriver(Driver):
 
         name = findtext(element, 'name', TYPES_URN)
 
+        try:
+            hm = element.find(fixxpath('healthMonitor', TYPES_URN)).get('id')
+        except AttributeError:
+            hm = None
+
         node = NttCisVIPNode(
             id=element.get('id'),
             name=name,
             status=self._VALUE_TO_STATE_MAP.get(
                 findtext(element, 'state', TYPES_URN),
                 State.UNKNOWN),
-            health_monitor=element.find(fixxpath('healthMonitor',
-                                                 TYPES_URN)).get('id'),
+            health_monitor=hm,
             connection_rate_limit=findtext(element,
                                            'connectionRateLimit', TYPES_URN),
             connection_limit=findtext(element, 'connectionLimit', TYPES_URN),


Mime
View raw message