From 64ccd3c50001d03f595078e18de7d5f8d3aa103c Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Thu, 6 Aug 2015 11:11:39 -0500 Subject: [PATCH] Add role_ids, role_names to v3 fixture Commit 6950527 in python-keystoneclient added role_ids and role_names properties to fixtures.v3.Token, and they're used in keystoneclient unit tests, so adding these will allow keystoneclient to switch to using keystoneauth fixtures. Change-Id: Ic5fa6a427a7b52d3c50b8022ac98a87f3cb630a1 --- keystoneauth1/fixture/v3.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/keystoneauth1/fixture/v3.py b/keystoneauth1/fixture/v3.py index b5344245..f5acbf9f 100644 --- a/keystoneauth1/fixture/v3.py +++ b/keystoneauth1/fixture/v3.py @@ -327,6 +327,14 @@ class Token(dict): def audit_chain_id(self, value): self.root['audit_ids'] = [self.audit_id, value] + @property + def role_ids(self): + return [r['id'] for r in self.root.get('roles', [])] + + @property + def role_names(self): + return [r['name'] for r in self.root.get('roles', [])] + def validate(self): project = self.root.get('project') domain = self.root.get('domain')