Repository: libcloud
Updated Branches:
  refs/heads/trunk 4816cbbfd -> 39e92cb1a


Fix OpenStack IP type resolution

Closes #738

Signed-off-by: Tomaz Muraus <to...@tomaz.me>


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

Branch: refs/heads/trunk
Commit: 0bcc7d61ced3471466b523768b873a7b0b1710db
Parents: 4816cbb
Author: lionel <lio...@sixsq.com>
Authored: Wed Apr 6 14:50:01 2016 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Wed Apr 13 19:03:20 2016 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/openstack.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/0bcc7d61/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py 
b/libcloud/compute/drivers/openstack.py
index c775603..51adf75 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -2074,16 +2074,16 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
                 # public and 'fixed' for private
                 explicit_ip_type = value.get('OS-EXT-IPS:type', None)
 
-                if explicit_ip_type == 'floating':
+                if public_subnet:
+                    # Check for public subnet
+                    is_public_ip = True
+                elif explicit_ip_type == 'floating':
                     is_public_ip = True
                 elif explicit_ip_type == 'fixed':
                     is_public_ip = False
                 elif label in public_networks_labels:
                     # Try label next
                     is_public_ip = True
-                elif public_subnet:
-                    # Check for public subnet
-                    is_public_ip = True
 
                 if is_public_ip:
                     public_ips.append(ip)
@@ -2108,6 +2108,7 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
             created_at=created,
             driver=self,
             extra=dict(
+                addresses=api_node['addresses'],
                 hostId=api_node['hostId'],
                 access_ip=api_node.get('accessIPv4'),
                 access_ipv6=api_node.get('accessIPv6', None),

Reply via email to