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/07/10 07:45:19 UTC

[01/11] libcloud git commit: add references to other auth methods

Repository: libcloud
Updated Branches:
  refs/heads/trunk 9b15645fc -> cfe02ecaf


add references to other auth methods


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

Branch: refs/heads/trunk
Commit: f907e896e60fc500a658048b058bd72b978614b9
Parents: a421668
Author: Anthony Shaw <an...@apache.org>
Authored: Thu May 4 11:13:57 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Thu May 4 11:13:57 2017 +1000

----------------------------------------------------------------------
 docs/compute/drivers/openstack.rst | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f907e896/docs/compute/drivers/openstack.rst
----------------------------------------------------------------------
diff --git a/docs/compute/drivers/openstack.rst b/docs/compute/drivers/openstack.rst
index e7a5e33..248bf37 100644
--- a/docs/compute/drivers/openstack.rst
+++ b/docs/compute/drivers/openstack.rst
@@ -45,6 +45,10 @@ Available arguments:
     and API key
   * ``2.0_password`` - authenticate against keystone with a username and
     password
+  * ``2.0_voms`` - 2.0 VOMS key
+  * ``3.x_password`` - 3.x keystone password
+  * ``3.x_oidc_access_token`` - OIDC access token
+
 
   Unless you are working with a very old version of OpenStack you will either
   want to use ``2.0_apikey`` or ``2.0_password``.


[06/11] libcloud git commit: openstack example

Posted by an...@apache.org.
openstack example


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

Branch: refs/heads/trunk
Commit: 384f63d7c09cd9455f6ba420dfa2cc721562ba3d
Parents: 17fa4a3
Author: Anthony Shaw <an...@apache.org>
Authored: Fri May 5 14:58:18 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri May 5 14:58:18 2017 +1000

----------------------------------------------------------------------
 demos/example_openstack.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/384f63d7/demos/example_openstack.py
----------------------------------------------------------------------
diff --git a/demos/example_openstack.py b/demos/example_openstack.py
new file mode 100644
index 0000000..4e3c42b
--- /dev/null
+++ b/demos/example_openstack.py
@@ -0,0 +1,17 @@
+from pprint import pprint
+
+from libcloud.compute.providers import get_driver
+from libcloud.compute.types import Provider
+
+Openstack = get_driver(Provider.OPENSTACK)
+
+con = Openstack(
+    'admin', 'password',
+    ex_force_auth_url='http://23.12.198.36/identity/v3/auth/tokens',
+    ex_force_base_url='http://23.12.198.36:8774/v2.1',
+    api_version='2.0',
+    ex_tenant_name='demo')
+
+pprint(con.list_locations())
+pprint(con.list_images())
+pprint(con.list_nodes())


[02/11] libcloud git commit: add default paths for v3 keystone, a v2 connection/node API and documentation

Posted by an...@apache.org.
add default paths for v3 keystone, a v2 connection/node API and documentation


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

Branch: refs/heads/trunk
Commit: 1867fdab66ef9e762af9a5a33c8c1e85d84366fc
Parents: f907e89
Author: Anthony Shaw <an...@apache.org>
Authored: Thu May 4 11:42:48 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Thu May 4 11:42:48 2017 +1000

----------------------------------------------------------------------
 libcloud/common/openstack_identity.py |  4 ++++
 libcloud/compute/drivers/openstack.py | 29 +++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/1867fdab/libcloud/common/openstack_identity.py
----------------------------------------------------------------------
diff --git a/libcloud/common/openstack_identity.py b/libcloud/common/openstack_identity.py
index 9e841cf..7adad20 100644
--- a/libcloud/common/openstack_identity.py
+++ b/libcloud/common/openstack_identity.py
@@ -1060,6 +1060,10 @@ class OpenStackIdentity_3_0_Connection(OpenStackIdentityConnection):
                 raise MalformedResponseError('Auth JSON response is \
                                              missing required elements', e)
             body = 'code: %s body:%s' % (response.status, response.body)
+        elif response.status == 300:
+            # ambiguous version request
+            raise LibcloudError('Auth request returned ambiguous version error, try' 
+                                'using the version specific URL to connect, e.g. identity/v3/auth/tokens')
         else:
             body = 'code: %s body:%s' % (response.status, response.body)
             raise MalformedResponseError('Malformed response', body=body,

http://git-wip-us.apache.org/repos/asf/libcloud/blob/1867fdab/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index fc39b3e..38fd3aa 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -134,6 +134,8 @@ class OpenStackNodeDriver(NodeDriver, OpenStackDriverMixin):
                 cls = OpenStack_1_0_NodeDriver
             elif api_version == '1.1':
                 cls = OpenStack_1_1_NodeDriver
+            elif api_version in ['2.0', '2.1', '2.2']:
+                cls = OpenStack_2_NodeDriver
             else:
                 raise NotImplementedError(
                     "No OpenStackNodeDriver found for API version %s" %
@@ -2435,6 +2437,33 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
         return resp.status == httplib.ACCEPTED
 
 
+class OpenStack_2_Connection(OpenStackComputeConnection):
+    responseCls = OpenStack_1_1_Response
+    accept_format = 'application/json'
+    default_content_type = 'application/json; charset=UTF-8'
+
+    def encode_data(self, data):
+        return json.dumps(data)
+
+
+class OpenStack_2_NodeDriver(OpenStack_1_1_NodeDriver):
+    """
+    OpenStack node driver.
+    """
+    connectionCls = OpenStack_2_Connection
+    type = Provider.OPENSTACK
+
+    features = {"create_node": ["generates_password"]}
+    _networks_url_prefix = '/os-networks'
+
+    def __init__(self, *args, **kwargs):
+        self._ex_force_api_version = str(kwargs.pop('ex_force_api_version',
+                                                    None))
+        if 'ex_force_auth_version' not in kwargs:
+            kwargs['ex_force_auth_version'] = '3.x_password'
+        super(OpenStack_2_NodeDriver, self).__init__(*args, **kwargs)
+
+
 class OpenStack_1_1_FloatingIpPool(object):
     """
     Floating IP Pool info.


[09/11] libcloud git commit: remove unused code

Posted by an...@apache.org.
remove unused code


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

Branch: refs/heads/trunk
Commit: f09d133625d7df602b01b22e82350a2774f0da4a
Parents: c5a4f37
Author: Anthony Shaw <an...@apache.org>
Authored: Fri May 5 15:29:48 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri May 5 15:29:48 2017 +1000

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f09d1336/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 606f7b8..9f81203 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -61,7 +61,6 @@ BASE_DIR = os.path.abspath(os.path.split(__file__)[0])
 
 
 def test_driver_instantiation_invalid_auth():
-    forced_auth = 'http://x.y.z.y:5000'
     with pytest.raises(LibcloudError):
         d = OpenStackNodeDriver(
             'user', 'correct_password',


[10/11] libcloud git commit: Merge branch 'openstack_updates' into trunk

Posted by an...@apache.org.
Merge branch 'openstack_updates' into trunk


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

Branch: refs/heads/trunk
Commit: 40f711c48bf179a48ea3ebe451f07999fbb47617
Parents: 9b15645 f09d133
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Jul 10 08:41:56 2017 +0100
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Jul 10 08:41:56 2017 +0100

----------------------------------------------------------------------
 demos/example_openstack.py              | 17 ++++++++++++++++
 docs/compute/drivers/openstack.rst      | 30 ++++++++++++++++++++++++++++
 libcloud/common/openstack_identity.py   |  6 ++++++
 libcloud/compute/drivers/openstack.py   | 29 +++++++++++++++++++++++++++
 libcloud/test/compute/test_openstack.py | 18 ++++++++++++++---
 5 files changed, 97 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[04/11] libcloud git commit: add the openstack test classes as a unittest.TestCase type

Posted by an...@apache.org.
add the openstack test classes as a unittest.TestCase type


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

Branch: refs/heads/trunk
Commit: e318420c5c490995f099ed07dae0f014145ff104
Parents: 123442f
Author: Anthony Shaw <an...@apache.org>
Authored: Fri May 5 09:05:15 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri May 5 09:05:15 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/e318420c/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 77d35e6..06f6b28 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -81,7 +81,7 @@ class OpenStackAuthTests(unittest.TestCase):
             self.assertEqual(d.connection.host, 'test_endpoint.com')
 
 
-class OpenStack_1_0_Tests(TestCaseMixin):
+class OpenStack_1_0_Tests(TestCaseMixin, unittest.TestCase):
     should_list_locations = False
     should_list_volumes = False
 


[08/11] libcloud git commit: add a test for bad versions of authentication versioning

Posted by an...@apache.org.
add a test for bad versions of authentication versioning


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

Branch: refs/heads/trunk
Commit: c5a4f37eeb4f0a7eafb6d724b8af95aa7456e76a
Parents: d5a1d7b
Author: Anthony Shaw <an...@apache.org>
Authored: Fri May 5 15:01:15 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri May 5 15:01:15 2017 +1000

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c5a4f37e/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index fa09a48..606f7b8 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -19,6 +19,7 @@ import os
 import sys
 import unittest
 import datetime
+import pytest
 from libcloud.utils.iso8601 import UTC
 
 try:
@@ -44,7 +45,8 @@ from libcloud.compute.drivers.openstack import (
     OpenStack_1_1_NodeDriver, OpenStackSecurityGroup,
     OpenStackSecurityGroupRule, OpenStack_1_1_FloatingIpPool,
     OpenStack_1_1_FloatingIpAddress, OpenStackKeyPair,
-    OpenStack_1_0_Connection
+    OpenStack_1_0_Connection,
+    OpenStackNodeDriver
 )
 from libcloud.compute.base import Node, NodeImage, NodeSize
 from libcloud.pricing import set_pricing, clear_pricing_data
@@ -58,6 +60,17 @@ from libcloud.test.secrets import OPENSTACK_PARAMS
 BASE_DIR = os.path.abspath(os.path.split(__file__)[0])
 
 
+def test_driver_instantiation_invalid_auth():
+    forced_auth = 'http://x.y.z.y:5000'
+    with pytest.raises(LibcloudError):
+        d = OpenStackNodeDriver(
+            'user', 'correct_password',
+            ex_force_auth_version='5.0',
+            ex_force_auth_url='http://x.y.z.y:5000',
+            ex_tenant_name='admin')
+        d.list_nodes()
+
+
 class OpenStackAuthTests(unittest.TestCase):
     def setUp(self):
         OpenStack_1_0_NodeDriver.connectionCls = OpenStack_1_0_Connection


[11/11] libcloud git commit: changes for #1052

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


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

Branch: refs/heads/trunk
Commit: cfe02ecaf1b8ee623795a0266a81aaec4cada763
Parents: 40f711c
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Jul 10 08:42:52 2017 +0100
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Jul 10 08:42:52 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/cfe02eca/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index e434ba8..3c1a713 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -30,6 +30,10 @@ Common
 Compute
 ~~~~~~~
 
+- [OPENSTACK] Add support for Nova 2.x and Keystone 3
+  [GITHUB-1052]
+  (Anthony Shaw)
+
 - [GCE] Add loadBalancingScheme parameter for
  ex_create_forwarding_rule method in GCE driver.
   [GITHUB-1079]


[07/11] libcloud git commit: add a description of specifying the nova api version

Posted by an...@apache.org.
add a description of specifying the nova api version


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

Branch: refs/heads/trunk
Commit: d5a1d7b1c83c0b4a508a9dd36503457ab33274af
Parents: 384f63d
Author: Anthony Shaw <an...@apache.org>
Authored: Fri May 5 15:00:53 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri May 5 15:00:53 2017 +1000

----------------------------------------------------------------------
 docs/compute/drivers/openstack.rst | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/d5a1d7b1/docs/compute/drivers/openstack.rst
----------------------------------------------------------------------
diff --git a/docs/compute/drivers/openstack.rst b/docs/compute/drivers/openstack.rst
index 248bf37..17f9cc0 100644
--- a/docs/compute/drivers/openstack.rst
+++ b/docs/compute/drivers/openstack.rst
@@ -13,6 +13,32 @@ Among many other private clouds, it also powers Rackspace's Public Cloud.
 
 .. _connecting-to-openstack-installation:
 
+Selecting the Nova API version
+------------------------------
+
+Along with your connection criteria, you can specify the Nova version with `api_version`, 
+currently supported versions of Nova are:
+
+- 1.0
+- 1.1
+- 2.0
+- 2.1 (v12)
+- 2.2 (v13)
+
+.. code-block:: python
+
+  from libcloud.compute.providers import get_driver
+  from libcloud.compute.types import Provider
+
+  Openstack = get_driver(Provider.OPENSTACK)
+
+  con = Openstack(
+      'admin', 'password',
+      ex_force_base_url='http://23.12.198.36:8774/v2.1',
+      api_version='2.0',
+      ex_tenant_name='demo')
+
+
 Connecting to the OpenStack installation
 ----------------------------------------
 


[03/11] libcloud git commit: lint fixes

Posted by an...@apache.org.
lint fixes


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

Branch: refs/heads/trunk
Commit: 123442fa7059ccad7a4281e6bdf173130d3fe085
Parents: 1867fda
Author: Anthony Shaw <an...@apache.org>
Authored: Thu May 4 12:31:39 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Thu May 4 12:31:39 2017 +1000

----------------------------------------------------------------------
 libcloud/common/openstack_identity.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/123442fa/libcloud/common/openstack_identity.py
----------------------------------------------------------------------
diff --git a/libcloud/common/openstack_identity.py b/libcloud/common/openstack_identity.py
index 7adad20..102e2e0 100644
--- a/libcloud/common/openstack_identity.py
+++ b/libcloud/common/openstack_identity.py
@@ -1062,8 +1062,10 @@ class OpenStackIdentity_3_0_Connection(OpenStackIdentityConnection):
             body = 'code: %s body:%s' % (response.status, response.body)
         elif response.status == 300:
             # ambiguous version request
-            raise LibcloudError('Auth request returned ambiguous version error, try' 
-                                'using the version specific URL to connect, e.g. identity/v3/auth/tokens')
+            raise LibcloudError(
+                'Auth request returned ambiguous version error, try'
+                'using the version specific URL to connect,'
+                ' e.g. identity/v3/auth/tokens')
         else:
             body = 'code: %s body:%s' % (response.status, response.body)
             raise MalformedResponseError('Malformed response', body=body,


[05/11] libcloud git commit: fix openstack tests

Posted by an...@apache.org.
fix openstack tests


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

Branch: refs/heads/trunk
Commit: 17fa4a3c24754df8ebf01176ee37cfab4dbf52b5
Parents: e318420
Author: Anthony Shaw <an...@apache.org>
Authored: Fri May 5 12:02:12 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri May 5 12:02:12 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/17fa4a3c/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 06f6b28..fa09a48 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -510,7 +510,7 @@ class OpenStackMockHttp(MockHttp, unittest.TestCase):
             raise NotImplementedError()
         # this is currently used for deletion of an image
         # as such it should not accept GET/POST
-        return(httplib.NO_CONTENT, "", "", httplib.responses[httplib.NO_CONTENT])
+        return(httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT])
 
     def _v1_0_slug_images(self, method, url, body, headers):
         if method != "POST":