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 2014/03/11 19:04:37 UTC

[1/3] git commit: [LIBCLOUD-503] OpenStack public ip addresses fix

Repository: libcloud
Updated Branches:
  refs/heads/trunk 0619c9257 -> 8b3bb0f94


[LIBCLOUD-503] OpenStack public ip addresses fix

Closes #235

Signed-off-by: Tomaz Muraus <to...@apache.org>


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

Branch: refs/heads/trunk
Commit: 859a0a4f769c32761944e35bea0efac88add8207
Parents: 0619c92
Author: Markos Gogoulos <mg...@mist.io>
Authored: Fri Jan 31 13:53:43 2014 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Mar 11 19:02:30 2014 +0100

----------------------------------------------------------------------
 libcloud/compute/drivers/openstack.py   | 11 ++++++++++-
 libcloud/test/compute/test_openstack.py | 12 ++++++++----
 2 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/859a0a4f/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index aba37bc..c7d0b09 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -37,6 +37,7 @@ except ImportError:
 from libcloud.common.openstack import OpenStackBaseConnection
 from libcloud.common.openstack import OpenStackDriverMixin
 from libcloud.common.types import MalformedResponseError, ProviderError
+from libcloud.utils.networking import is_private_subnet
 from libcloud.compute.base import NodeSize, NodeImage
 from libcloud.compute.base import (NodeDriver, Node, NodeLocation,
                                    StorageVolume, VolumeSnapshot)
@@ -1987,7 +1988,15 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
             if label in public_networks_labels:
                 public_ips.extend(ips)
             else:
-                private_ips.extend(ips)
+                for ip in ips:
+                    #is_private_subnet does not check for ipv6
+                    try:
+                        if is_private_subnet(ip):
+                            private_ips.append(ip)
+                        else:
+                            public_ips.append(ip)
+                    except:
+                        private_ips.append(ip)
 
         # Sometimes 'image' attribute is not present if the node is in an error
         # state

http://git-wip-us.apache.org/repos/asf/libcloud/blob/859a0a4f/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 1bb6487..bdc6979 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -961,11 +961,15 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin):
         node = nodes[0]
 
         self.assertEqual('12065', node.id)
-        self.assertEqual('50.57.94.35', node.public_ips[0])
-        self.assertEqual(
-            '2001:4801:7808:52:16:3eff:fe47:788a', node.public_ips[1])
+        #test public IPv4
+        self.assertTrue('12.16.18.28' in node.public_ips)
+        self.assertTrue('50.57.94.35' in node.public_ips)
+        #test public IPv6
+        self.assertTrue(
+            '2001:4801:7808:52:16:3eff:fe47:788a' in node.public_ips)
+        #test private IPv4
         self.assertTrue('10.182.64.34' in node.private_ips)
-        self.assertTrue('12.16.18.28' in node.private_ips)
+        #test private IPv6
         self.assertTrue(
             'fec0:4801:7808:52:16:3eff:fe60:187d' in node.private_ips)
 


[2/3] git commit: Update CHANGES.

Posted by to...@apache.org.
Update CHANGES.


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

Branch: refs/heads/trunk
Commit: 106a5986c7e5d19b30216410c4c4e6890c7366d7
Parents: 859a0a4
Author: Tomaz Muraus <to...@apache.org>
Authored: Tue Mar 11 18:59:23 2014 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Mar 11 19:02:36 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/106a5986/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 6f0ac85..6b01e32 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -57,6 +57,10 @@ Compute
   (LIBCLOUD-526, GITHUB-257)
   [Jim Divine]
 
+- Fix IP address handling in the OpenStack driver.
+  (LIBCLOUD-503, GITHUB-235)
+  [Markos Gogoulos]
+
 Load Balancer
 ~~~~~~~~~~~~~
 


[3/3] git commit: Fix a path in the documentation for testing.

Posted by to...@apache.org.
Fix a path in the documentation for testing.

Signed-off-by: Tomaz Muraus <to...@apache.org>


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

Branch: refs/heads/trunk
Commit: 8b3bb0f94d0371968f3bc4e38dcd65fc66e3a5e6
Parents: 106a598
Author: Franck Cuny <fr...@gmail.com>
Authored: Tue Mar 11 07:58:41 2014 -0700
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Mar 11 19:02:50 2014 +0100

----------------------------------------------------------------------
 docs/testing.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/8b3bb0f9/docs/testing.rst
----------------------------------------------------------------------
diff --git a/docs/testing.rst b/docs/testing.rst
index 808d32e..3cef350 100644
--- a/docs/testing.rst
+++ b/docs/testing.rst
@@ -64,7 +64,7 @@ For example:
 
 .. sourcecode:: bash
 
-    PYTHONPATH=. python libcloud/test/libcloud/test/compute/test_ec2.py
+    PYTHONPATH=. python libcloud/test/compute/test_ec2.py
 
 Generating Test Coverage Report
 -------------------------------