Follow-up patch for 7c5a04c114

This patch addresses the change in message text suggested in the
review 7c5a04c114.

Change-Id: Iddb693e4271a12d28f5b8eb954a4579d5a5d2571
This commit is contained in:
Shivanand Tendulker 2018-07-26 05:25:04 -04:00
parent 40af9848ac
commit 8d3aa1bb28
2 changed files with 6 additions and 6 deletions

View File

@ -82,9 +82,9 @@ class AgentClient(object):
try:
response = self.session.post(url, params=request_params, data=body)
except requests.ConnectionError as e:
msg = (_('Failed to invoke agent command %(method)s for node '
'%(node)s. Error: %(error)s') %
{'method': method, 'node': node.uuid, 'error': e})
msg = (_('Failed to connect to the agent running on node %(node)s '
'for invoking command %(method)s. Error: %(error)s') %
{'node': node.uuid, 'method': method, 'error': e})
LOG.error(msg)
raise exception.AgentConnectionFailed(reason=msg)
except requests.RequestException as e:

View File

@ -145,9 +145,9 @@ class TestAgentClient(base.TestCase):
e = self.assertRaises(exception.AgentConnectionFailed,
self.client._command,
self.node, method, params)
self.assertEqual('Connection to agent failed: Failed to invoke '
'agent command %(method)s for node %(node)s. '
'Error: %(error)s' %
self.assertEqual('Connection to agent failed: Failed to connect to '
'the agent running on node %(node)s for invoking '
'command %(method)s. Error: %(error)s' %
{'method': method, 'node': self.node.uuid,
'error': error}, str(e))