summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZiad Sawalha <github@highbridgellc.com>2011-12-17 13:57:13 -0600
committerZiad Sawalha <github@highbridgellc.com>2011-12-17 13:57:19 -0600
commit0b03a1def22f44de6f3c6830c64cf08c1827ddd1 (patch)
treedf2d5cceb93487d6f9a2cae66774dc5488401b3d
parent1e391f02bbc6f83e7a0c5221665a5c573aae8625 (diff)
Support for unscoped admin tokens
- Fixes bug 887877 - Updates to sampledata to not scope admin/serviceadmin tokens to customer-x - Fix 'undocumented' bug in keystone-manage that fails to handle 'None' correctly for tenant Change-Id: Iaa7f8897c79ca5e4811d1f15a1b307ae1313b656
-rw-r--r--keystone/manage/api.py3
-rw-r--r--keystone/test/sampledata.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/keystone/manage/api.py b/keystone/manage/api.py
index e9e295ca..02aea17a 100644
--- a/keystone/manage/api.py
+++ b/keystone/manage/api.py
@@ -145,7 +145,8 @@ def add_endpoint(tenant, endpoint_template):
def add_token(token, user, tenant, expires):
user = db_api.USER.get_by_name(name=user).id
- tenant = db_api.TENANT.get_by_name(name=tenant).id
+ if tenant:
+ tenant = db_api.TENANT.get_by_name(name=tenant).id
obj = models.Token()
obj.id = token
diff --git a/keystone/test/sampledata.py b/keystone/test/sampledata.py
index 677845dc..63533ffc 100644
--- a/keystone/test/sampledata.py
+++ b/keystone/test/sampledata.py
@@ -90,9 +90,9 @@ DEFAULT_FIXTURE = [
# Tokens
('token', 'add', '887665443383838', 'joeuser', 'customer-x',
'2012-02-05T00:00'),
- ('token', 'add', '999888777666', 'admin', 'customer-x',
+ ('token', 'add', '999888777666', 'admin', None,
'2015-02-05T00:00'),
- ('token', 'add', '111222333444', 'serviceadmin', 'customer-x',
+ ('token', 'add', '111222333444', 'serviceadmin', None,
'2015-02-05T00:00'),
('token', 'add', '000999', 'admin', 'customer-x', '2010-02-05T00:00'),
('token', 'add', '999888777', 'disabled', 'customer-x',