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/08/18 13:22:18 UTC

git commit: Add list_projects / list_tenants method to OpenStackIdentity_2_0 class.

Repository: libcloud
Updated Branches:
  refs/heads/trunk 950f972c3 -> c849b95af


Add list_projects / list_tenants method to OpenStackIdentity_2_0 class.

Also re-organize fixtures in directories based on the API version.


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

Branch: refs/heads/trunk
Commit: c849b95af822ca32c2cd75fc280682b81426116a
Parents: 950f972
Author: Tomaz Muraus <to...@apache.org>
Authored: Mon Aug 18 12:25:21 2014 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Mon Aug 18 12:48:46 2014 +0200

----------------------------------------------------------------------
 libcloud/common/openstack_identity.py           |  45 ++++---
 libcloud/test/common/test_openstack_identity.py |  36 ++++-
 .../openstack_identity/v2/v2_0_tenants.json     |  17 +++
 .../openstack_identity/v3/v3_create_user.json   |  12 ++
 .../openstack_identity/v3/v3_domains.json       |  18 +++
 .../v3/v3_domains_default.json                  |  11 ++
 .../v3/v3_domains_default_users_a_roles.json    |  16 +++
 .../openstack_identity/v3/v3_projects.json      |  49 +++++++
 .../openstack_identity/v3/v3_roles.json         |  25 ++++
 .../openstack_identity/v3/v3_users.json         | 131 +++++++++++++++++++
 .../openstack_identity/v3/v3_users_a.json       |  18 +++
 .../v3/v3_users_a_projects.json                 |   8 ++
 .../openstack_identity/v3/v3_versions.json      |  58 ++++++++
 .../openstack_identity/v3_create_user.json      |  12 --
 .../fixtures/openstack_identity/v3_domains.json |  18 ---
 .../openstack_identity/v3_domains_default.json  |  11 --
 .../v3_domains_default_users_a_roles.json       |  16 ---
 .../openstack_identity/v3_projects.json         |  49 -------
 .../fixtures/openstack_identity/v3_roles.json   |  25 ----
 .../fixtures/openstack_identity/v3_users.json   | 131 -------------------
 .../fixtures/openstack_identity/v3_users_a.json |  18 ---
 .../openstack_identity/v3_users_a_projects.json |   8 --
 .../openstack_identity/v3_versions.json         |  58 --------
 23 files changed, 424 insertions(+), 366 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/common/openstack_identity.py
----------------------------------------------------------------------
diff --git a/libcloud/common/openstack_identity.py b/libcloud/common/openstack_identity.py
index 3363aac..3eb0d14 100644
--- a/libcloud/common/openstack_identity.py
+++ b/libcloud/common/openstack_identity.py
@@ -117,12 +117,12 @@ class OpenStackIdentityDomain(object):
 
 
 class OpenStackIdentityProject(object):
-    def __init__(self, id, domain_id, name, description, enabled):
+    def __init__(self, id, name, description, enabled, domain_id=None):
         self.id = id
-        self.domain_id = domain_id
         self.name = name
         self.description = description
         self.enabled = enabled
+        self.domain_id = domain_id
 
     def __repr__(self):
         return (('<OpenStackIdentityProject id=%s, domain_id=%s, name=%s, '
@@ -708,6 +708,23 @@ class OpenStackIdentityConnection(ConnectionUserAndKey):
 
         return True
 
+    def _to_projects(self, data):
+        result = []
+        for item in data:
+            project = self._to_project(data=item)
+            result.append(project)
+
+        return result
+
+    def _to_project(self, data):
+        project = OpenStackIdentityProject(id=data['id'],
+                                           name=data['name'],
+                                           description=data['description'],
+                                           enabled=data['enabled'],
+                                           domain_id=data.get('domain_id',
+                                                              None))
+        return project
+
 
 class OpenStackIdentity_1_0_Connection(OpenStackIdentityConnection):
     """
@@ -878,6 +895,14 @@ class OpenStackIdentity_2_0_Connection(OpenStackIdentityConnection):
 
         return self
 
+    def list_projects(self):
+        response = self.authenticated_request('/v2.0/tenants', method='GET')
+        result = self._to_projects(data=response.object['tenants'])
+        return result
+
+    def list_tenants(self):
+        return self.list_projects()
+
 
 class OpenStackIdentity_3_0_Connection(OpenStackIdentityConnection):
     """
@@ -1308,22 +1333,6 @@ class OpenStackIdentity_3_0_Connection(OpenStackIdentityConnection):
                                          enabled=data['enabled'])
         return domain
 
-    def _to_projects(self, data):
-        result = []
-        for item in data:
-            project = self._to_project(data=item)
-            result.append(project)
-
-        return result
-
-    def _to_project(self, data):
-        project = OpenStackIdentityProject(id=data['id'],
-                                           domain_id=data['domain_id'],
-                                           name=data['name'],
-                                           description=data['description'],
-                                           enabled=data['enabled'])
-        return project
-
     def _to_users(self, data):
         result = []
         for item in data:

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/common/test_openstack_identity.py
----------------------------------------------------------------------
diff --git a/libcloud/test/common/test_openstack_identity.py b/libcloud/test/common/test_openstack_identity.py
index 9ebd599..7c57cf1 100644
--- a/libcloud/test/common/test_openstack_identity.py
+++ b/libcloud/test/common/test_openstack_identity.py
@@ -27,8 +27,8 @@ from libcloud.utils.py3 import httplib
 from libcloud.common.openstack import OpenStackBaseConnection
 from libcloud.common.openstack_identity import AUTH_TOKEN_EXPIRES_GRACE_SECONDS
 from libcloud.common.openstack_identity import get_class_for_auth_version
-from libcloud.common.openstack_identity import OpenStackIdentity_2_0_Connection
 from libcloud.common.openstack_identity import OpenStackServiceCatalog
+from libcloud.common.openstack_identity import OpenStackIdentity_2_0_Connection
 from libcloud.common.openstack_identity import OpenStackIdentity_3_0_Connection
 from libcloud.common.openstack_identity import OpenStackIdentityUser
 from libcloud.compute.drivers.openstack import OpenStack_1_0_NodeDriver
@@ -222,6 +222,27 @@ class OpenStackIdentityConnectionTestCase(unittest.TestCase):
         return connection
 
 
+class OpenStackIdentity_2_0_ConnectionTests(unittest.TestCase):
+    def setUp(self):
+        mock_cls = OpenStackIdentity_2_0_MockHttp
+        mock_cls.type = None
+        OpenStackIdentity_2_0_Connection.conn_classes = (mock_cls, mock_cls)
+
+        self.auth_instance = OpenStackIdentity_2_0_Connection(auth_url='http://none',
+                                                              user_id='test',
+                                                              key='test',
+                                                              tenant_name='test')
+        self.auth_instance.auth_token = 'mock'
+
+    def test_list_projects(self):
+        result = self.auth_instance.list_projects()
+        self.assertEqual(len(result), 2)
+        self.assertEqual(result[0].id, 'a')
+        self.assertEqual(result[0].name, 'test')
+        self.assertEqual(result[0].description, 'test project')
+        self.assertTrue(result[0].enabled)
+
+
 class OpenStackIdentity_3_0_ConnectionTests(unittest.TestCase):
     def setUp(self):
         mock_cls = OpenStackIdentity_3_0_MockHttp
@@ -520,8 +541,19 @@ class OpenStackServiceCatalogTestCase(unittest.TestCase):
                                          'nova'])
 
 
+class OpenStackIdentity_2_0_MockHttp(MockHttp):
+    fixtures = ComputeFileFixtures('openstack_identity/v2')
+    json_content_headers = {'content-type': 'application/json; charset=UTF-8'}
+
+    def _v2_0_tenants(self, method, url, body, headers):
+        if method == 'GET':
+            body = self.fixtures.load('v2_0_tenants.json')
+            return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK])
+        raise NotImplementedError()
+
+
 class OpenStackIdentity_3_0_MockHttp(MockHttp):
-    fixtures = ComputeFileFixtures('openstack_identity')
+    fixtures = ComputeFileFixtures('openstack_identity/v3')
     json_content_headers = {'content-type': 'application/json; charset=UTF-8'}
 
     def _v3(self, method, url, body, headers):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v2/v2_0_tenants.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v2/v2_0_tenants.json b/libcloud/test/compute/fixtures/openstack_identity/v2/v2_0_tenants.json
new file mode 100644
index 0000000..e0d497f
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v2/v2_0_tenants.json
@@ -0,0 +1,17 @@
+{
+    "tenants": [
+        {
+            "description": "test project",
+            "enabled": true,
+            "id": "a",
+            "name": "test"
+        },
+        {
+            "description": "admin tenant",
+            "enabled": true,
+            "id": "b",
+            "name": "admin"
+        }
+    ],
+    "tenants_links": []
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_create_user.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_create_user.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_create_user.json
new file mode 100644
index 0000000..82445dc
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_create_user.json
@@ -0,0 +1,12 @@
+{
+    "user": {
+        "name": "test2",
+        "links": {
+            "self": "http://192.168.18.100:5000/v3/users/c"
+        },
+        "domain_id": "default",
+        "enabled": true,
+        "email": "test2@localhost",
+        "id": "c"
+    }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains.json
new file mode 100644
index 0000000..7813acf
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains.json
@@ -0,0 +1,18 @@
+{
+    "domains": [
+        {
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/domains/default"
+            },
+            "enabled": true,
+            "description": "Owns users and tenants (i.e. projects) available on Identity API v2.",
+            "name": "Default",
+            "id": "default"
+        }
+    ],
+    "links": {
+        "self": "http://192.168.18.100:5000/v3/domains",
+        "previous": null,
+        "next": null
+    }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains_default.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains_default.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains_default.json
new file mode 100644
index 0000000..f00230f
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains_default.json
@@ -0,0 +1,11 @@
+{
+    "domain": {
+        "links": {
+            "self": "http://192.168.18.100:5000/v3/domains/default"
+        },
+        "enabled": true,
+        "description": "Owns users and tenants (i.e. projects) available on Identity API v2.",
+        "name": "Default",
+        "id": "default"
+    }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains_default_users_a_roles.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains_default_users_a_roles.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains_default_users_a_roles.json
new file mode 100644
index 0000000..0312072
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_domains_default_users_a_roles.json
@@ -0,0 +1,16 @@
+{
+    "links": {
+        "self": "http://192.168.18.100:5000/v3/domains/default/users/a/roles",
+        "previous": null,
+        "next": null
+    },
+    "roles": [
+        {
+            "id": "d",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/roles/d"
+            },
+            "name": "admin"
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_projects.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_projects.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_projects.json
new file mode 100644
index 0000000..16acbce
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_projects.json
@@ -0,0 +1,49 @@
+{
+    "links": {
+        "self": "http://192.168.18.100:5000/v3/projects",
+        "previous": null,
+        "next": null
+    },
+    "projects": [
+        {
+            "description": "Test project",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/projects/a"
+            },
+            "enabled": true,
+            "id": "a",
+            "domain_id": "default",
+            "name": "divvy"
+        },
+        {
+            "description": "Admin Tenant",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/projects/b"
+            },
+            "enabled": true,
+            "id": "b",
+            "domain_id": "default",
+            "name": "admin"
+        },
+        {
+            "description": "Initial tenant",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/projects/c"
+            },
+            "enabled": true,
+            "id": "c",
+            "domain_id": "default",
+            "name": "first-tenant"
+        },
+        {
+            "description": "Service Tenant",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/projects/d"
+            },
+            "enabled": true,
+            "id": "d",
+            "domain_id": "default",
+            "name": "service"
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_roles.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_roles.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_roles.json
new file mode 100644
index 0000000..5785484
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_roles.json
@@ -0,0 +1,25 @@
+{
+    "links": {
+        "self": "http://192.168.18.100:5000/v3/roles",
+        "previous": null,
+        "next": null
+    },
+    "roles": [
+        {
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/roles/a"
+            },
+            "enabled": "True",
+            "description": "Default role for project membership",
+            "name": "_member_",
+            "id": "a"
+        },
+        {
+            "id": "b",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/roles/b"
+            },
+            "name": "admin"
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users.json
new file mode 100644
index 0000000..d4763ea
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users.json
@@ -0,0 +1,131 @@
+{
+    "users": [
+        {
+            "name": "cloud",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/a"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "openstack-test@localhost",
+            "id": "a"
+        },
+        {
+            "name": "trove",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/1ec8cface8614a2786c99c87c7116f09"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "trove@localhost",
+            "id": "1ec8cface8614a2786c99c87c7116f09"
+        },
+        {
+            "domain_id": "default",
+            "name": "tomaz",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/458f20357227462e8a17355628984515"
+            },
+            "id": "458f20357227462e8a17355628984515",
+            "enabled": true,
+            "email": "tomaz@tomaz.me",
+            "default_project_id": "3130562cafe147f289bbb3b557f2e7ed"
+        },
+        {
+            "name": "admin",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/55fba80f022b4855acfc700ae13b2b24"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "openstack-test@localhost",
+            "id": "55fba80f022b4855acfc700ae13b2b24"
+        },
+        {
+            "name": "nova",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/679c69c6cfd049ebb3ad85734dfea61a"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "nova@localhost",
+            "id": "679c69c6cfd049ebb3ad85734dfea61a"
+        },
+        {
+            "name": "glance",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/6f10443170ad4daf81bff251944da9d7"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "glance@localhost",
+            "id": "6f10443170ad4daf81bff251944da9d7"
+        },
+        {
+            "name": "ceilometer",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/747cf6a2bf75453f847f307823e8eac9"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "ceilometer@localhost",
+            "id": "747cf6a2bf75453f847f307823e8eac9"
+        },
+        {
+            "name": "swift",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/a0081ee2f9674458bcd7731b6dcbf5f9"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "swift@localhost",
+            "id": "a0081ee2f9674458bcd7731b6dcbf5f9"
+        },
+        {
+            "domain_id": "default",
+            "name": "amann",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/aafb942e4c3d4fe1ba33088f3e7c5996"
+            },
+            "id": "aafb942e4c3d4fe1ba33088f3e7c5996",
+            "enabled": true,
+            "email": "andrew@divvycloud.com",
+            "default_project_id": "3130562cafe147f289bbb3b557f2e7ed"
+        },
+        {
+            "name": "heat",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/d16cad10e4f648e0bd9ab5a0359f6736"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "heat@localhost",
+            "id": "d16cad10e4f648e0bd9ab5a0359f6736"
+        },
+        {
+            "name": "cinder",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/f3a4590b0d66497894ee9a3d73c09a95"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "cinder@localhost",
+            "id": "f3a4590b0d66497894ee9a3d73c09a95"
+        },
+        {
+            "name": "neutron",
+            "links": {
+                "self": "http://192.168.18.100:5000/v3/users/fa9a7fedeb2844ff89e37d70a2519441"
+            },
+            "domain_id": "default",
+            "enabled": true,
+            "email": "neutron@localhost",
+            "id": "fa9a7fedeb2844ff89e37d70a2519441"
+        }
+    ],
+    "links": {
+        "self": "http://192.168.18.100:5000/v3/users",
+        "previous": null,
+        "next": null
+    }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_a.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_a.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_a.json
new file mode 100644
index 0000000..4d0a359
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_a.json
@@ -0,0 +1,18 @@
+{
+    "user": 
+      {
+          "name": "cloud",
+          "links": {
+              "self": "http://192.168.18.100:5000/v3/users/a"
+          },
+          "domain_id": "default",
+          "enabled": true,
+          "email": "openstack-test@localhost",
+          "id": "a"
+      },
+    "links": {
+        "self": "http://192.168.18.100:5000/v3/users",
+        "previous": null,
+        "next": null
+    }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_a_projects.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_a_projects.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_a_projects.json
new file mode 100644
index 0000000..e117a8b
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_users_a_projects.json
@@ -0,0 +1,8 @@
+{
+    "links": {
+        "self": "http://192.168.18.100:5000/v3/users/a/projects",
+        "previous": null,
+        "next": null
+    },
+    "projects": []
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_versions.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3/v3_versions.json b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_versions.json
new file mode 100644
index 0000000..c63b938
--- /dev/null
+++ b/libcloud/test/compute/fixtures/openstack_identity/v3/v3_versions.json
@@ -0,0 +1,58 @@
+{
+    "versions": {
+        "values": [
+            {
+                "status": "stable",
+                "updated": "2013-03-06T00:00:00Z",
+                "media-types": [
+                    {
+                        "base": "application/json",
+                        "type": "application/vnd.openstack.identity-v3+json"
+                    },
+                    {
+                        "base": "application/xml",
+                        "type": "application/vnd.openstack.identity-v3+xml"
+                    }
+                ],
+                "id": "v3.0",
+                "links": [
+                    {
+                        "href": "http://192.168.18.100:5000/v3/",
+                        "rel": "self"
+                    }
+                ]
+            },
+            {
+                "status": "stable",
+                "updated": "2014-04-17T00:00:00Z",
+                "media-types": [
+                    {
+                        "base": "application/json",
+                        "type": "application/vnd.openstack.identity-v2.0+json"
+                    },
+                    {
+                        "base": "application/xml",
+                        "type": "application/vnd.openstack.identity-v2.0+xml"
+                    }
+                ],
+                "id": "v2.0",
+                "links": [
+                    {
+                        "href": "http://192.168.18.100:5000/v2.0/",
+                        "rel": "self"
+                    },
+                    {
+                        "href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/",
+                        "type": "text/html",
+                        "rel": "describedby"
+                    },
+                    {
+                        "href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf",
+                        "type": "application/pdf",
+                        "rel": "describedby"
+                    }
+                ]
+            }
+        ]
+    }
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_create_user.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_create_user.json b/libcloud/test/compute/fixtures/openstack_identity/v3_create_user.json
deleted file mode 100644
index 82445dc..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_create_user.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-    "user": {
-        "name": "test2",
-        "links": {
-            "self": "http://192.168.18.100:5000/v3/users/c"
-        },
-        "domain_id": "default",
-        "enabled": true,
-        "email": "test2@localhost",
-        "id": "c"
-    }
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_domains.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_domains.json b/libcloud/test/compute/fixtures/openstack_identity/v3_domains.json
deleted file mode 100644
index 7813acf..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_domains.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-    "domains": [
-        {
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/domains/default"
-            },
-            "enabled": true,
-            "description": "Owns users and tenants (i.e. projects) available on Identity API v2.",
-            "name": "Default",
-            "id": "default"
-        }
-    ],
-    "links": {
-        "self": "http://192.168.18.100:5000/v3/domains",
-        "previous": null,
-        "next": null
-    }
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_domains_default.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_domains_default.json b/libcloud/test/compute/fixtures/openstack_identity/v3_domains_default.json
deleted file mode 100644
index f00230f..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_domains_default.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-    "domain": {
-        "links": {
-            "self": "http://192.168.18.100:5000/v3/domains/default"
-        },
-        "enabled": true,
-        "description": "Owns users and tenants (i.e. projects) available on Identity API v2.",
-        "name": "Default",
-        "id": "default"
-    }
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_domains_default_users_a_roles.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_domains_default_users_a_roles.json b/libcloud/test/compute/fixtures/openstack_identity/v3_domains_default_users_a_roles.json
deleted file mode 100644
index 0312072..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_domains_default_users_a_roles.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-    "links": {
-        "self": "http://192.168.18.100:5000/v3/domains/default/users/a/roles",
-        "previous": null,
-        "next": null
-    },
-    "roles": [
-        {
-            "id": "d",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/roles/d"
-            },
-            "name": "admin"
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_projects.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_projects.json b/libcloud/test/compute/fixtures/openstack_identity/v3_projects.json
deleted file mode 100644
index 16acbce..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_projects.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
-    "links": {
-        "self": "http://192.168.18.100:5000/v3/projects",
-        "previous": null,
-        "next": null
-    },
-    "projects": [
-        {
-            "description": "Test project",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/projects/a"
-            },
-            "enabled": true,
-            "id": "a",
-            "domain_id": "default",
-            "name": "divvy"
-        },
-        {
-            "description": "Admin Tenant",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/projects/b"
-            },
-            "enabled": true,
-            "id": "b",
-            "domain_id": "default",
-            "name": "admin"
-        },
-        {
-            "description": "Initial tenant",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/projects/c"
-            },
-            "enabled": true,
-            "id": "c",
-            "domain_id": "default",
-            "name": "first-tenant"
-        },
-        {
-            "description": "Service Tenant",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/projects/d"
-            },
-            "enabled": true,
-            "id": "d",
-            "domain_id": "default",
-            "name": "service"
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_roles.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_roles.json b/libcloud/test/compute/fixtures/openstack_identity/v3_roles.json
deleted file mode 100644
index 5785484..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_roles.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-    "links": {
-        "self": "http://192.168.18.100:5000/v3/roles",
-        "previous": null,
-        "next": null
-    },
-    "roles": [
-        {
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/roles/a"
-            },
-            "enabled": "True",
-            "description": "Default role for project membership",
-            "name": "_member_",
-            "id": "a"
-        },
-        {
-            "id": "b",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/roles/b"
-            },
-            "name": "admin"
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_users.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_users.json b/libcloud/test/compute/fixtures/openstack_identity/v3_users.json
deleted file mode 100644
index d4763ea..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_users.json
+++ /dev/null
@@ -1,131 +0,0 @@
-{
-    "users": [
-        {
-            "name": "cloud",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/a"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "openstack-test@localhost",
-            "id": "a"
-        },
-        {
-            "name": "trove",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/1ec8cface8614a2786c99c87c7116f09"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "trove@localhost",
-            "id": "1ec8cface8614a2786c99c87c7116f09"
-        },
-        {
-            "domain_id": "default",
-            "name": "tomaz",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/458f20357227462e8a17355628984515"
-            },
-            "id": "458f20357227462e8a17355628984515",
-            "enabled": true,
-            "email": "tomaz@tomaz.me",
-            "default_project_id": "3130562cafe147f289bbb3b557f2e7ed"
-        },
-        {
-            "name": "admin",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/55fba80f022b4855acfc700ae13b2b24"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "openstack-test@localhost",
-            "id": "55fba80f022b4855acfc700ae13b2b24"
-        },
-        {
-            "name": "nova",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/679c69c6cfd049ebb3ad85734dfea61a"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "nova@localhost",
-            "id": "679c69c6cfd049ebb3ad85734dfea61a"
-        },
-        {
-            "name": "glance",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/6f10443170ad4daf81bff251944da9d7"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "glance@localhost",
-            "id": "6f10443170ad4daf81bff251944da9d7"
-        },
-        {
-            "name": "ceilometer",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/747cf6a2bf75453f847f307823e8eac9"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "ceilometer@localhost",
-            "id": "747cf6a2bf75453f847f307823e8eac9"
-        },
-        {
-            "name": "swift",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/a0081ee2f9674458bcd7731b6dcbf5f9"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "swift@localhost",
-            "id": "a0081ee2f9674458bcd7731b6dcbf5f9"
-        },
-        {
-            "domain_id": "default",
-            "name": "amann",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/aafb942e4c3d4fe1ba33088f3e7c5996"
-            },
-            "id": "aafb942e4c3d4fe1ba33088f3e7c5996",
-            "enabled": true,
-            "email": "andrew@divvycloud.com",
-            "default_project_id": "3130562cafe147f289bbb3b557f2e7ed"
-        },
-        {
-            "name": "heat",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/d16cad10e4f648e0bd9ab5a0359f6736"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "heat@localhost",
-            "id": "d16cad10e4f648e0bd9ab5a0359f6736"
-        },
-        {
-            "name": "cinder",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/f3a4590b0d66497894ee9a3d73c09a95"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "cinder@localhost",
-            "id": "f3a4590b0d66497894ee9a3d73c09a95"
-        },
-        {
-            "name": "neutron",
-            "links": {
-                "self": "http://192.168.18.100:5000/v3/users/fa9a7fedeb2844ff89e37d70a2519441"
-            },
-            "domain_id": "default",
-            "enabled": true,
-            "email": "neutron@localhost",
-            "id": "fa9a7fedeb2844ff89e37d70a2519441"
-        }
-    ],
-    "links": {
-        "self": "http://192.168.18.100:5000/v3/users",
-        "previous": null,
-        "next": null
-    }
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_users_a.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_users_a.json b/libcloud/test/compute/fixtures/openstack_identity/v3_users_a.json
deleted file mode 100644
index 4d0a359..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_users_a.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-    "user": 
-      {
-          "name": "cloud",
-          "links": {
-              "self": "http://192.168.18.100:5000/v3/users/a"
-          },
-          "domain_id": "default",
-          "enabled": true,
-          "email": "openstack-test@localhost",
-          "id": "a"
-      },
-    "links": {
-        "self": "http://192.168.18.100:5000/v3/users",
-        "previous": null,
-        "next": null
-    }
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_users_a_projects.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_users_a_projects.json b/libcloud/test/compute/fixtures/openstack_identity/v3_users_a_projects.json
deleted file mode 100644
index e117a8b..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_users_a_projects.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    "links": {
-        "self": "http://192.168.18.100:5000/v3/users/a/projects",
-        "previous": null,
-        "next": null
-    },
-    "projects": []
-}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c849b95a/libcloud/test/compute/fixtures/openstack_identity/v3_versions.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_identity/v3_versions.json b/libcloud/test/compute/fixtures/openstack_identity/v3_versions.json
deleted file mode 100644
index c63b938..0000000
--- a/libcloud/test/compute/fixtures/openstack_identity/v3_versions.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
-    "versions": {
-        "values": [
-            {
-                "status": "stable",
-                "updated": "2013-03-06T00:00:00Z",
-                "media-types": [
-                    {
-                        "base": "application/json",
-                        "type": "application/vnd.openstack.identity-v3+json"
-                    },
-                    {
-                        "base": "application/xml",
-                        "type": "application/vnd.openstack.identity-v3+xml"
-                    }
-                ],
-                "id": "v3.0",
-                "links": [
-                    {
-                        "href": "http://192.168.18.100:5000/v3/",
-                        "rel": "self"
-                    }
-                ]
-            },
-            {
-                "status": "stable",
-                "updated": "2014-04-17T00:00:00Z",
-                "media-types": [
-                    {
-                        "base": "application/json",
-                        "type": "application/vnd.openstack.identity-v2.0+json"
-                    },
-                    {
-                        "base": "application/xml",
-                        "type": "application/vnd.openstack.identity-v2.0+xml"
-                    }
-                ],
-                "id": "v2.0",
-                "links": [
-                    {
-                        "href": "http://192.168.18.100:5000/v2.0/",
-                        "rel": "self"
-                    },
-                    {
-                        "href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/",
-                        "type": "text/html",
-                        "rel": "describedby"
-                    },
-                    {
-                        "href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf",
-                        "type": "application/pdf",
-                        "rel": "describedby"
-                    }
-                ]
-            }
-        ]
-    }
-}