Merge "Use RPC cast() to be asynchronous"

This commit is contained in:
Jenkins 2017-02-03 08:48:56 +00:00 committed by Gerrit Code Review
commit 4b5dce51dc
4 changed files with 6 additions and 6 deletions

View File

@ -36,7 +36,7 @@ class ApplierAPI(service.Service):
if not utils.is_uuid_like(action_plan_uuid):
raise exception.InvalidUuidOrName(name=action_plan_uuid)
return self.conductor_client.call(
self.conductor_client.cast(
context, 'launch_action_plan', action_plan_uuid=action_plan_uuid)

View File

@ -37,7 +37,7 @@ class DecisionEngineAPI(service.Service):
if not utils.is_uuid_like(audit_uuid):
raise exception.InvalidUuidOrName(name=audit_uuid)
return self.conductor_client.call(
self.conductor_client.cast(
context, 'trigger_audit', audit_uuid=audit_uuid)

View File

@ -43,10 +43,10 @@ class TestApplierAPI(base.TestCase):
api_version=rpcapi.ApplierAPI().API_VERSION)
def test_execute_audit_without_error(self):
with mock.patch.object(om.RPCClient, 'call') as mock_call:
with mock.patch.object(om.RPCClient, 'cast') as mock_cast:
action_plan_uuid = utils.generate_uuid()
self.api.launch_action_plan(self.context, action_plan_uuid)
mock_call.assert_called_once_with(
mock_cast.assert_called_once_with(
self.context,
'launch_action_plan',
action_plan_uuid=action_plan_uuid)

View File

@ -44,8 +44,8 @@ class TestDecisionEngineAPI(base.TestCase):
audit_uuid)
def test_execute_audit_without_error(self):
with mock.patch.object(om.RPCClient, 'call') as mock_call:
with mock.patch.object(om.RPCClient, 'cast') as mock_cast:
audit_uuid = utils.generate_uuid()
self.api.trigger_audit(self.context, audit_uuid)
mock_call.assert_called_once_with(
mock_cast.assert_called_once_with(
self.context, 'trigger_audit', audit_uuid=audit_uuid)