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 2013/11/27 19:19:49 UTC

[2/3] git commit: Make the node name detection in CloudStack driver more robust. Some newer versions use 'name' instead of 'displayname' attribute.

Make the node name detection in CloudStack driver more robust. Some newer
versions use 'name' instead of 'displayname' attribute.


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

Branch: refs/heads/trunk
Commit: b86e6a7ccf6fb5c3a08314434c3992db6c736468
Parents: af0ef29
Author: Tomaz Muraus <to...@apache.org>
Authored: Wed Nov 27 17:58:58 2013 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Wed Nov 27 17:58:58 2013 +0100

----------------------------------------------------------------------
 libcloud/compute/drivers/cloudstack.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b86e6a7c/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index f35f46d..ea7c0e1 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -1267,7 +1267,14 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
         :type public_ips: ``list`` or ``None``
         """
         id = data['id']
-        name = data['displayname']
+
+        if 'name' in data:
+            name = data['name']
+        elif 'displayname' in data:
+            name = data['displayname']
+        else:
+            name = None
+
         state = self.NODE_STATE_MAP[data['state']]
 
         public_ips = public_ips if public_ips else []