From 13485a64c89e851d8e1d2be853aa568124d6bcea Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Wed, 29 Nov 2017 14:41:18 +0100 Subject: [PATCH] Run enable_ssh_admin also for Nova+Ironic deployments For Nova+Ironic deployments we could run the enable_ssh_admin Mistral workflow directly and take advantage of the public key injection via os-collect-config, but since the script seems to work for both deployed-server and Nova/Ironic envs, we can just use it unconditionally and keep the logic DRY. Change-Id: I2bae54d282591abc8a014cdce805e90305a7a34d Closes-Bug: #1735173 --- tripleoclient/workflows/deployment.py | 39 +++++++++++++-------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/tripleoclient/workflows/deployment.py b/tripleoclient/workflows/deployment.py index 0b2ced402..06d99cebd 100644 --- a/tripleoclient/workflows/deployment.py +++ b/tripleoclient/workflows/deployment.py @@ -111,29 +111,28 @@ def config_download(log, clients, stack, templates, deployed_server, if match: ips.append(line.split(' ')[0]) - if deployed_server: - script_path = os.path.join(templates, - 'deployed-server', - 'scripts', - 'enable-ssh-admin.sh') + script_path = os.path.join(templates, + 'deployed-server', + 'scripts', + 'enable-ssh-admin.sh') - env = os.environ.copy() - env.update(dict(OVERCLOUD_HOSTS=' '.join(ips), - OVERCLOUD_SSH_USER=ssh_user, - OVERCLOUD_SSH_KEY=ssh_key)) + env = os.environ.copy() + env.update(dict(OVERCLOUD_HOSTS=' '.join(ips), + OVERCLOUD_SSH_USER=ssh_user, + OVERCLOUD_SSH_KEY=ssh_key)) - proc = subprocess.Popen([script_path], env=env, shell=True, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + proc = subprocess.Popen([script_path], env=env, shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) - while True: - line = proc.stdout.readline().decode('utf-8') - if line: - log.info(line.rstrip()) - if line == '' and proc.poll() is not None: - break - if proc.returncode != 0: - raise RuntimeError('%s failed.' % script_path) + while True: + line = proc.stdout.readline().decode('utf-8') + if line: + log.info(line.rstrip()) + if line == '' and proc.poll() is not None: + break + if proc.returncode != 0: + raise RuntimeError('%s failed.' % script_path) workflow_client = clients.workflow_engine tripleoclients = clients.tripleoclient