Fixing test_perform_action errors

Change-Id: Ia6c466faf04fa6f9fc276ab92b8228eed2753ec6
This commit is contained in:
tonytan4ever 2015-10-16 17:19:10 -04:00
parent 0b3a10d188
commit 59bf4e03d8
2 changed files with 4 additions and 3 deletions

View File

@ -354,6 +354,7 @@ class TestSharedCertService(base.TestBase):
retry_interval=self.test_config.status_check_retry_interval,
retry_timeout=self.test_config.status_check_retry_timeout)
self.before_patch_body = resp.json()
self.my_domain = self.before_patch_body['domains'][0]['domain']
self.before_patch_state = resp.json()['status']
@ddt.data('enable', 'disable')
@ -388,7 +389,7 @@ class TestSharedCertService(base.TestBase):
@ddt.data('enable', 'disable')
def test_action_with_domain(self, action):
domain = self.domain_list[0]["domain"]
domain = self.my_domain
resp = self.operator_client.admin_service_action(
project_id=self.user_project_id, action=action,
domain=domain)
@ -483,7 +484,7 @@ class TestSharedCertService(base.TestBase):
self.assertEqual(resp.status_code, 404)
def test_action_delete_with_domain(self):
domain = self.domain_list[0]["domain"]
domain = self.my_domain
resp = self.operator_client.admin_service_action(
action='delete',
domain=domain)

View File

@ -74,7 +74,7 @@ class ServiceAction(base.AutoMarshallingModel):
}
if self.domain:
service_action_request["domain"] = self.domain
if self.project_id:
elif self.project_id:
service_action_request["project_id"] = self.project_id
return json.dumps(service_action_request)