diff options
-rw-r--r-- | snaps/openstack/tests/create_project_tests.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/snaps/openstack/tests/create_project_tests.py b/snaps/openstack/tests/create_project_tests.py index 9d53467..4e1d254 100644 --- a/snaps/openstack/tests/create_project_tests.py +++ b/snaps/openstack/tests/create_project_tests.py @@ -193,10 +193,12 @@ class CreateProjectUserTests(OSComponentTestCase): self.assertIsNotNone(sec_grp) self.sec_grp_creators.append(sec_grp_creator) - if self.keystone.version == keystone_utils.V2_VERSION: + if 'tenant_id' in sec_grp['security_group']: self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['tenant_id']) - else: + elif 'project_id' in sec_grp['security_group']: self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['project_id']) + else: + self.fail('Cannot locate the project or tenant ID') def test_create_project_sec_grp_two_users(self): """ @@ -225,4 +227,10 @@ class CreateProjectUserTests(OSComponentTestCase): sec_grp = sec_grp_creator.create() self.assertIsNotNone(sec_grp) self.sec_grp_creators.append(sec_grp_creator) - self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['tenant_id']) + + if 'tenant_id' in sec_grp['security_group']: + self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['tenant_id']) + elif 'project_id' in sec_grp['security_group']: + self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['project_id']) + else: + self.fail('Cannot locate the project or tenant ID') |