[stable-only] Raise error for temp_ssh_key import failure

We should not be ignoring the error as we would skip the
admin-enablement workflow and running ansible playbooks would
fail later.

Change-Id: I69c79b3bfec4467210ca6c480f61e14cbf1d0a44
Partial-Bug: #1873892
This commit is contained in:
Rabi Mishra 2020-04-27 14:12:14 +05:30
parent b95119250c
commit 5627d8d9cc
1 changed files with 7 additions and 3 deletions

View File

@ -23,6 +23,7 @@ import yaml
from heatclient.common import event_utils
from openstackclient import shell
import six
from tripleoclient.constants import ENABLE_SSH_ADMIN_SSH_PORT_TIMEOUT
from tripleoclient.constants import ENABLE_SSH_ADMIN_STATUS_INTERVAL
@ -199,11 +200,14 @@ def get_hosts_and_enable_ssh_admin(
enable_ssh_timeout, enable_ssh_port_timeout)
except subprocess.CalledProcessError as e:
if e.returncode == 255:
log.error("Couldn't not import keys to one of {}. "
"Check if the user/ip are corrects.\n".format(hosts))
log.error("Could not import keys to one of {}. "
"Original error message: {}\n".format(
hosts, six.text_type(e)))
else:
log.error("Unknown error. "
"Original message is:\n{}".format(hosts, e.message))
"Original error message:{}\n".format(
six.text_type(e)))
raise
else:
raise exceptions.DeploymentError("Cannot find any hosts on '{}'"