Remove extra information from std.ssh action

The ssh error message can lead to information leak.
Removing the extra ssh message effects only the CLI call,
the full message is still being logged

Change-Id: I0b28e1cb17d4ce3ae711a25b6eaffb4ebf00ccd6
Closes-Bug: 1783708
This commit is contained in:
apetrich 2018-09-03 14:00:22 +02:00 committed by Dougal Matthews
parent 604d905c24
commit c93b45a61f
1 changed files with 4 additions and 1 deletions

View File

@ -397,8 +397,11 @@ class SSHAction(actions.Action):
def raise_exc(parent_exc=None):
message = ("Failed to execute ssh cmd "
"'%s' on %s" % (self.cmd, self.host))
# We suppress the actual parent error messages in favor of
# more generic ones as we might be leaking information to the CLI
if parent_exc:
message += "\nException: %s" % str(parent_exc)
# The full error message needs to be logged regardless
LOG.exception(message + " Exception: %s", str(parent_exc))
raise exc.ActionException(message)
try: