summaryrefslogtreecommitdiff
path: root/keystoneclient/fixture
diff options
context:
space:
mode:
authorJamie Lennox <jamielennox@redhat.com>2015-04-17 09:16:00 +1000
committerJamie Lennox <jamielennox@redhat.com>2015-04-17 09:16:00 +1000
commit0abcaff9f77dd80d782d1a56d766740633ed8ec0 (patch)
tree9aacfc243b8aca5a071801678a8f26def85cfa9f /keystoneclient/fixture
parent85eeecbd3d06e98011def3d0d8329646cc175163 (diff)
downloadpython-keystoneclient-0abcaff9f77dd80d782d1a56d766740633ed8ec0.tar.gz
Add endpoint and service ids to fixtures
The service catalog should contain an endpoint id and service id in the v3 token and an endpoint id in the v2 token. Change-Id: I8835bcb7c68ae8d0175b6f58a4750cd6e25fd84c
Diffstat (limited to 'keystoneclient/fixture')
-rw-r--r--keystoneclient/fixture/v2.py5
-rw-r--r--keystoneclient/fixture/v3.py9
2 files changed, 8 insertions, 6 deletions
diff --git a/keystoneclient/fixture/v2.py b/keystoneclient/fixture/v2.py
index bbac2dc..3022f2c 100644
--- a/keystoneclient/fixture/v2.py
+++ b/keystoneclient/fixture/v2.py
@@ -21,12 +21,13 @@ from keystoneclient.fixture import exception
class _Service(dict):
def add_endpoint(self, public, admin=None, internal=None,
- tenant_id=None, region=None):
+ tenant_id=None, region=None, id=None):
data = {'tenantId': tenant_id or uuid.uuid4().hex,
'publicURL': public,
'adminURL': admin or public,
'internalURL': internal or public,
- 'region': region}
+ 'region': region,
+ 'id': id or uuid.uuid4().hex}
self.setdefault('endpoints', []).append(data)
return data
diff --git a/keystoneclient/fixture/v3.py b/keystoneclient/fixture/v3.py
index 646e46d..a1781dd 100644
--- a/keystoneclient/fixture/v3.py
+++ b/keystoneclient/fixture/v3.py
@@ -25,8 +25,9 @@ class _Service(dict):
this object and then you can add_endpoints to the service.
"""
- def add_endpoint(self, interface, url, region=None):
- data = {'interface': interface,
+ def add_endpoint(self, interface, url, region=None, id=None):
+ data = {'id': id or uuid.uuid4().hex,
+ 'interface': interface,
'url': url,
'region': region,
'region_id': region}
@@ -354,8 +355,8 @@ class Token(dict):
roles.append(data)
return data
- def add_service(self, type, name=None):
- service = _Service(type=type)
+ def add_service(self, type, name=None, id=None):
+ service = _Service(type=type, id=id or uuid.uuid4().hex)
if name:
service['name'] = name
self.root.setdefault('catalog', []).append(service)