Pass stack name to enable_ssh_admin workflow

Pass the stack/plan name to the enable_ssh_admin workflow, otherwise,
only the default 'overcloud' name works.

Depends-On: Ie5dbe86232c3b6a85665a9eec08ace8ba9415ea1
Change-Id: I76531c5fb36135cfd733ddb6980bf43d0295db30
Closes-Bug: #1795417
This commit is contained in:
James Slagle 2018-10-01 10:37:09 -04:00
parent 6b40eecc63
commit 23f19693a5
3 changed files with 5 additions and 2 deletions

View File

@ -67,7 +67,7 @@ class TestDeploymentWorkflows(utils.TestCommand):
mock_state.state = 'SUCCESS'
self.workflow.executions.get.return_value = mock_state
deployment.enable_ssh_admin(log, self.app.client_manager,
hosts, ssh_user, ssh_key)
'overcloud', hosts, ssh_user, ssh_key)
# once for ssh-keygen, then twice per host
self.assertEqual(7, mock_check_call.call_count)
@ -112,6 +112,7 @@ class TestDeploymentWorkflows(utils.TestCommand):
self.assertRaises(exceptions.DeploymentError,
deployment.enable_ssh_admin,
log, self.app.client_manager,
'overcloud',
hosts, ssh_user, ssh_key)
@mock.patch('tripleoclient.utils.get_role_net_ip_map')

View File

@ -903,6 +903,7 @@ class DeployOvercloud(command.Command):
hosts = deployment.get_overcloud_hosts(
stack, parsed_args.overcloud_ssh_network)
deployment.enable_ssh_admin(self.log, self.clients,
stack.stack_name,
hosts,
parsed_args.overcloud_ssh_user,
parsed_args.overcloud_ssh_key)

View File

@ -154,7 +154,7 @@ def wait_for_ssh_port(host):
time.sleep(1)
def enable_ssh_admin(log, clients, hosts, ssh_user, ssh_key):
def enable_ssh_admin(log, clients, plan_name, hosts, ssh_user, ssh_key):
print("Enabling ssh admin (tripleo-admin) for hosts:")
print(" ".join(hosts))
print("Using ssh user %s for initial connection." % ssh_user)
@ -195,6 +195,7 @@ def enable_ssh_admin(log, clients, hosts, ssh_user, ssh_key):
"ssh_user": ssh_user,
"ssh_servers": hosts,
"ssh_private_key": open(tmp_key_private).read(),
"plan_name": plan_name
}
execution = base.start_workflow(