You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2017/04/22 02:35:14 UTC

[1/9] libcloud git commit: issues with LIBCLOUD-912

Repository: libcloud
Updated Branches:
  refs/heads/trunk 660a144da -> 741032969


issues with LIBCLOUD-912


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

Branch: refs/heads/trunk
Commit: b8ba6c10accdf6d9ce8a40787e2300a594437ebe
Parents: 55e5e82
Author: Anthony Shaw <an...@apache.org>
Authored: Fri Apr 21 17:21:55 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri Apr 21 17:21:55 2017 +1000

----------------------------------------------------------------------
 libcloud/test/common/test_openstack.py          |  2 +-
 .../compute/fixtures/openstack/_v2_0__auth.json |  6 ++---
 libcloud/test/compute/test_openstack.py         | 23 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b8ba6c10/libcloud/test/common/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/common/test_openstack.py b/libcloud/test/common/test_openstack.py
index 290ed3e..6780aa6 100644
--- a/libcloud/test/common/test_openstack.py
+++ b/libcloud/test/common/test_openstack.py
@@ -37,7 +37,7 @@ class OpenStackBaseConnectionTest(unittest.TestCase):
         self.assertEqual(self.connection.timeout, self.timeout)
         if PY25:
             self.connection.conn_class.assert_called_with(host='127.0.0.1',
-                                                               port=443)
+                                                          port=443)
         else:
             self.connection.conn_class.assert_called_with(host='127.0.0.1',
                                                           secure=1,

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b8ba6c10/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json b/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json
index c40a8ee..3adb2cd 100644
--- a/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json
+++ b/libcloud/test/compute/fixtures/openstack/_v2_0__auth.json
@@ -59,9 +59,9 @@
                     {
                         "region": "RegionOne",
                         "tenantId": "1337",
-                        "publicURL": "https://127.0.0.1/v2/1337",
-                        "versionInfo": "https://127.0.0.1/v2/",
-                        "versionList": "https://127.0.0.1/",
+                        "publicURL": "https://test_endpoint.com/v2/1337",
+                        "versionInfo": "https://test_endpoint.com/v2/",
+                        "versionList": "https://test_endpoint.com/",
                         "versionId": "2"
                     }
                 ],

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b8ba6c10/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 7611392..9dcfb53 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -27,6 +27,7 @@ except ImportError:
     import json
 
 from mock import Mock, patch
+import requests_mock
 
 from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import method_type
@@ -55,6 +56,28 @@ from libcloud.test.secrets import OPENSTACK_PARAMS
 BASE_DIR = os.path.abspath(os.path.split(__file__)[0])
 
 
+class OpenStackAuthTests(unittest.TestCase):
+    def setUp(self):
+        pass
+
+    def test_auth_host_passed(self):
+        forced_auth = 'http://x.y.z.y:5000'
+        d = OpenStack_1_0_NodeDriver(
+            'user', 'correct_password', 
+            ex_force_auth_version='2.0_password', 
+            ex_force_auth_url='http://x.y.z.y:5000', 
+            ex_tenant_name='admin')
+        self.assertEqual(d._ex_force_auth_url, forced_auth)
+        with requests_mock.Mocker() as mock:
+            body1 = "[]"
+            body2 = ComputeFileFixtures('openstack').load('_v2_0__auth.json')
+            mock.register_uri('GET', 'https://test_endpoint.com/v2/1337/servers/detail', text=body1,
+                              headers={'content-type': 'application/json; charset=UTF-8'})
+            mock.register_uri('POST', 'http://x.y.z.y:5000/v2.0/tokens', text=body2,
+                              headers={'content-type': 'application/json; charset=UTF-8'})
+            d.list_nodes()
+
+
 class OpenStack_1_0_Tests(TestCaseMixin):
     should_list_locations = False
     should_list_volumes = False


[8/9] libcloud git commit: Merge branch 'openstack_auth_passing' into trunk Closes #1037

Posted by an...@apache.org.
Merge branch 'openstack_auth_passing' into trunk
Closes #1037


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

Branch: refs/heads/trunk
Commit: 3fd20259dad72964048299395563908cae100f09
Parents: 660a144 9be9f9f
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 22 12:30:00 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 22 12:30:00 2017 +1000

----------------------------------------------------------------------
 libcloud/common/openstack.py                    |  1 +
 libcloud/test/common/test_openstack.py          |  7 +++--
 .../compute/fixtures/openstack/_v2_0__auth.json |  6 ++---
 libcloud/test/compute/test_openstack.py         | 28 +++++++++++++++++++-
 4 files changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------



[4/9] libcloud git commit: allow the tests to be called in another sequence

Posted by an...@apache.org.
allow the tests to be called in another sequence


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

Branch: refs/heads/trunk
Commit: daaac0d61a5f9ce2afe2cc9b805c25fe774d57f9
Parents: eaaf699
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 22 08:09:58 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 22 08:09:58 2017 +1000

----------------------------------------------------------------------
 libcloud/test/compute/test_openstack.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/daaac0d6/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index d00a467..3351db9 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -42,7 +42,8 @@ from libcloud.compute.drivers.openstack import (
     OpenStack_1_0_NodeDriver,
     OpenStack_1_1_NodeDriver, OpenStackSecurityGroup,
     OpenStackSecurityGroupRule, OpenStack_1_1_FloatingIpPool,
-    OpenStack_1_1_FloatingIpAddress, OpenStackKeyPair
+    OpenStack_1_1_FloatingIpAddress, OpenStackKeyPair,
+    OpenStack_1_0_Connection
 )
 from libcloud.compute.base import Node, NodeImage, NodeSize
 from libcloud.pricing import set_pricing, clear_pricing_data
@@ -58,7 +59,7 @@ BASE_DIR = os.path.abspath(os.path.split(__file__)[0])
 
 class OpenStackAuthTests(unittest.TestCase):
     def setUp(self):
-        pass
+        OpenStack_1_0_NodeDriver.connectionCls = OpenStack_1_0_Connection
 
     def test_auth_host_passed(self):
         forced_auth = 'http://x.y.z.y:5000'


[9/9] libcloud git commit: changes for #1037

Posted by an...@apache.org.
changes for #1037


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

Branch: refs/heads/trunk
Commit: 74103296985e66a9abe0126a05b20fb22362a280
Parents: 3fd2025
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 22 12:33:42 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 22 12:33:42 2017 +1000

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/74103296/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 03d8990..a13e34c 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -7,6 +7,11 @@ Changes in current version of Apache Libcloud
 Common
 ~~~~~~
 
+- Fix OpenStack drivers not correctly setting URLs when used with identity API, would default to 127.0.0.1 and service
+  catalog URLs were not adhered to.
+  [GITHUB-1037, LIBCLOUD-912, LIBCLOUD-904]
+  (Anthony Shaw) 
+
 - Fix Aliyun ECS, Load balancer and storage adapters when using unicode UTF-8 characters in the names of resources
   in 2.0.0rc2 < it would fail as a MalformedResponseError, Python 2.7 element tree was raising a unicode error
   [GITHUB-1032] [GITHUB-994]


[7/9] libcloud git commit: write teardowns for openstack tests

Posted by an...@apache.org.
write teardowns for openstack tests


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

Branch: refs/heads/trunk
Commit: 9be9f9f22c8f7714afc62ba0cb02d13dd044e687
Parents: a28a079
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 22 12:20:06 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 22 12:20:06 2017 +1000

----------------------------------------------------------------------
 libcloud/test/common/test_openstack.py  | 5 ++++-
 libcloud/test/compute/test_openstack.py | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/9be9f9f2/libcloud/test/common/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/common/test_openstack.py b/libcloud/test/common/test_openstack.py
index 6780aa6..b5e9341 100644
--- a/libcloud/test/common/test_openstack.py
+++ b/libcloud/test/common/test_openstack.py
@@ -17,7 +17,7 @@ import sys
 import unittest
 
 from mock import Mock
-
+from libcloud.common.base import LibcloudConnection
 from libcloud.common.openstack import OpenStackBaseConnection
 from libcloud.utils.py3 import PY25
 
@@ -32,6 +32,9 @@ class OpenStackBaseConnectionTest(unittest.TestCase):
         self.connection.driver = Mock()
         self.connection.driver.name = 'OpenStackDriver'
 
+    def tearDown(self):
+        OpenStackBaseConnection.conn_class = LibcloudConnection
+
     def test_base_connection_timeout(self):
         self.connection.connect()
         self.assertEqual(self.connection.timeout, self.timeout)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/9be9f9f2/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index b6b6917..77d35e6 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -33,6 +33,7 @@ from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import method_type
 from libcloud.utils.py3 import u
 
+from libcloud.common.base import LibcloudConnection
 from libcloud.common.types import InvalidCredsError, MalformedResponseError, \
     LibcloudError
 from libcloud.compute.types import Provider, KeyPairDoesNotExistError, StorageVolumeState, \
@@ -60,6 +61,7 @@ BASE_DIR = os.path.abspath(os.path.split(__file__)[0])
 class OpenStackAuthTests(unittest.TestCase):
     def setUp(self):
         OpenStack_1_0_NodeDriver.connectionCls = OpenStack_1_0_Connection
+        OpenStack_1_0_NodeDriver.connectionCls.conn_class = LibcloudConnection
 
     def test_auth_host_passed(self):
         forced_auth = 'http://x.y.z.y:5000'


[2/9] libcloud git commit: update test to validate custom host servce endpoint and fix issue

Posted by an...@apache.org.
update test to validate custom host servce endpoint and fix issue


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

Branch: refs/heads/trunk
Commit: 3fd07eb590f1cf5898a329a9649df881a6c0f12f
Parents: b8ba6c1
Author: Anthony Shaw <an...@apache.org>
Authored: Fri Apr 21 20:00:33 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri Apr 21 20:00:33 2017 +1000

----------------------------------------------------------------------
 libcloud/common/openstack.py            |  1 +
 libcloud/test/compute/test_openstack.py | 12 +++++-------
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/3fd07eb5/libcloud/common/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/common/openstack.py b/libcloud/common/openstack.py
index 07796b5..1350205 100644
--- a/libcloud/common/openstack.py
+++ b/libcloud/common/openstack.py
@@ -297,6 +297,7 @@ class OpenStackBaseConnection(ConnectionUserAndKey):
     def _set_up_connection_info(self, url):
         result = self._tuple_from_url(url)
         (self.host, self.port, self.secure, self.request_path) = result
+        self.connect()
 
     def _populate_hosts_and_request_paths(self):
         """

http://git-wip-us.apache.org/repos/asf/libcloud/blob/3fd07eb5/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 9dcfb53..b42f43d 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -63,19 +63,17 @@ class OpenStackAuthTests(unittest.TestCase):
     def test_auth_host_passed(self):
         forced_auth = 'http://x.y.z.y:5000'
         d = OpenStack_1_0_NodeDriver(
-            'user', 'correct_password', 
-            ex_force_auth_version='2.0_password', 
-            ex_force_auth_url='http://x.y.z.y:5000', 
+            'user', 'correct_password',
+            ex_force_auth_version='2.0_password',
+            ex_force_auth_url='http://x.y.z.y:5000',
             ex_tenant_name='admin')
         self.assertEqual(d._ex_force_auth_url, forced_auth)
         with requests_mock.Mocker() as mock:
-            body1 = "[]"
             body2 = ComputeFileFixtures('openstack').load('_v2_0__auth.json')
-            mock.register_uri('GET', 'https://test_endpoint.com/v2/1337/servers/detail', text=body1,
-                              headers={'content-type': 'application/json; charset=UTF-8'})
             mock.register_uri('POST', 'http://x.y.z.y:5000/v2.0/tokens', text=body2,
                               headers={'content-type': 'application/json; charset=UTF-8'})
-            d.list_nodes()
+            d.connection._populate_hosts_and_request_paths()
+            self.assertEqual(d.connection.host, 'test_endpoint.com')
 
 
 class OpenStack_1_0_Tests(TestCaseMixin):


[3/9] libcloud git commit: refactor the test to not call internal methods

Posted by an...@apache.org.
refactor the test to not call internal methods


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

Branch: refs/heads/trunk
Commit: eaaf69900b59c98ba4e91123869a35f20af0d349
Parents: 3fd07eb
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 22 08:05:26 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 22 08:05:26 2017 +1000

----------------------------------------------------------------------
 libcloud/test/compute/test_openstack.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/eaaf6990/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index b42f43d..d00a467 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -69,10 +69,14 @@ class OpenStackAuthTests(unittest.TestCase):
             ex_tenant_name='admin')
         self.assertEqual(d._ex_force_auth_url, forced_auth)
         with requests_mock.Mocker() as mock:
+            body1 = ComputeFileFixtures('openstack').load('v1_slug_servers_ips.xml')
             body2 = ComputeFileFixtures('openstack').load('_v2_0__auth.json')
+
+            mock.register_uri('GET', 'https://test_endpoint.com/v2/1337/servers/test/ips', text=body1,
+                              headers={'content-type': 'application/xml; charset=UTF-8'})
             mock.register_uri('POST', 'http://x.y.z.y:5000/v2.0/tokens', text=body2,
                               headers={'content-type': 'application/json; charset=UTF-8'})
-            d.connection._populate_hosts_and_request_paths()
+            d.ex_list_ip_addresses('test')
             self.assertEqual(d.connection.host, 'test_endpoint.com')
 
 


[5/9] libcloud git commit: simplify the test

Posted by an...@apache.org.
simplify the test


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

Branch: refs/heads/trunk
Commit: 8560d2077873049a06e5fe62899d2197584c9d43
Parents: daaac0d
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 22 08:30:49 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 22 08:30:49 2017 +1000

----------------------------------------------------------------------
 libcloud/test/compute/test_openstack.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/8560d207/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 3351db9..029db10 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -69,15 +69,13 @@ class OpenStackAuthTests(unittest.TestCase):
             ex_force_auth_url='http://x.y.z.y:5000',
             ex_tenant_name='admin')
         self.assertEqual(d._ex_force_auth_url, forced_auth)
+        
         with requests_mock.Mocker() as mock:
-            body1 = ComputeFileFixtures('openstack').load('v1_slug_servers_ips.xml')
             body2 = ComputeFileFixtures('openstack').load('_v2_0__auth.json')
 
-            mock.register_uri('GET', 'https://test_endpoint.com/v2/1337/servers/test/ips', text=body1,
-                              headers={'content-type': 'application/xml; charset=UTF-8'})
             mock.register_uri('POST', 'http://x.y.z.y:5000/v2.0/tokens', text=body2,
                               headers={'content-type': 'application/json; charset=UTF-8'})
-            d.ex_list_ip_addresses('test')
+            d.connection._populate_hosts_and_request_paths()
             self.assertEqual(d.connection.host, 'test_endpoint.com')
 
 


[6/9] libcloud git commit: remove empty line

Posted by an...@apache.org.
remove empty line


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

Branch: refs/heads/trunk
Commit: a28a0799298cebcb2a102acc4a35465e50e02688
Parents: 8560d20
Author: Anthony Shaw <an...@apache.org>
Authored: Sat Apr 22 08:34:53 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Apr 22 08:34:53 2017 +1000

----------------------------------------------------------------------
 libcloud/test/compute/test_openstack.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/a28a0799/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 029db10..b6b6917 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -69,7 +69,7 @@ class OpenStackAuthTests(unittest.TestCase):
             ex_force_auth_url='http://x.y.z.y:5000',
             ex_tenant_name='admin')
         self.assertEqual(d._ex_force_auth_url, forced_auth)
-        
+
         with requests_mock.Mocker() as mock:
             body2 = ComputeFileFixtures('openstack').load('_v2_0__auth.json')