Merge "Add --output-dir"

This commit is contained in:
Zuul 2017-11-17 04:23:56 +00:00 committed by Gerrit Code Review
commit 5f4c522738
2 changed files with 18 additions and 3 deletions

View File

@ -902,6 +902,16 @@ class DeployOvercloud(command.Command):
default=False,
help=_('Run deployment via config-download mechanism')
)
parser.add_argument(
'--output-dir',
action='store',
default=None,
help=_('Directory to use for saved output when using '
'--config-download. The directory must be '
'writeable by the mistral user. When not '
'specified, the default server side value '
'will be used (/var/lib/mistral/<execution id>.')
)
return parser
def take_action(self, parsed_args):
@ -998,7 +1008,8 @@ class DeployOvercloud(command.Command):
parsed_args.templates,
parsed_args.deployed_server,
parsed_args.overcloud_ssh_user,
parsed_args.overcloud_ssh_key)
parsed_args.overcloud_ssh_key,
parsed_args.output_dir)
# Force fetching of attributes
stack.get()

View File

@ -97,7 +97,7 @@ def overcloudrc(workflow_client, **input_):
def config_download(log, clients, stack, templates, deployed_server,
ssh_user, ssh_key):
ssh_user, ssh_key, output_dir):
role_net_hostname_map = utils.get_role_net_hostname_map(stack)
hostnames = []
for role in role_net_hostname_map:
@ -138,11 +138,15 @@ def config_download(log, clients, stack, templates, deployed_server,
workflow_client = clients.workflow_engine
tripleoclients = clients.tripleoclient
workflow_input = {}
if output_dir:
workflow_input.update(dict(work_dir=output_dir))
with tripleoclients.messaging_websocket() as ws:
execution = base.start_workflow(
workflow_client,
'tripleo.deployment.v1.config_download_deploy',
workflow_input={}
workflow_input=workflow_input
)
for payload in base.wait_for_messages(workflow_client, ws, execution,