Merge "Add config-download-dir flag to cell export command" into stable/victoria
This commit is contained in:
commit
0172fd4cd3
|
@ -51,6 +51,11 @@ class ExportCell(command.Command):
|
||||||
parser.add_argument('--output-file', '-o', metavar='<output file>',
|
parser.add_argument('--output-file', '-o', metavar='<output file>',
|
||||||
help=_('Name of the output file for the cell data '
|
help=_('Name of the output file for the cell data '
|
||||||
'export. It will default to "<name>.yaml"'))
|
'export. It will default to "<name>.yaml"'))
|
||||||
|
parser.add_argument('--config-download-dir',
|
||||||
|
action='store',
|
||||||
|
help=_('Directory to search for config-download '
|
||||||
|
'export data. Defaults to '
|
||||||
|
'$HOME/config-download'))
|
||||||
parser.add_argument('--force-overwrite', '-f', action='store_true',
|
parser.add_argument('--force-overwrite', '-f', action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
help=_('Overwrite output file if it exists.'))
|
help=_('Overwrite output file if it exists.'))
|
||||||
|
@ -85,8 +90,13 @@ class ExportCell(command.Command):
|
||||||
stack_to_export = cell_stack
|
stack_to_export = cell_stack
|
||||||
should_filter = False
|
should_filter = False
|
||||||
|
|
||||||
config_download_dir = os.path.join(constants.DEFAULT_WORK_DIR,
|
if not parsed_args.config_download_dir:
|
||||||
stack_to_export)
|
download_dir = constants.DEFAULT_WORK_DIR
|
||||||
|
else:
|
||||||
|
download_dir = parsed_args.config_download_dir
|
||||||
|
|
||||||
|
config_download_dir = os.path.join(download_dir, stack_to_export)
|
||||||
|
|
||||||
data.update(export.export_stack(
|
data.update(export.export_stack(
|
||||||
clients.orchestration, stack_to_export, should_filter,
|
clients.orchestration, stack_to_export, should_filter,
|
||||||
config_download_dir))
|
config_download_dir))
|
||||||
|
|
Loading…
Reference in New Issue