Refactor BM deployment to use '--work-dir' - [2/2]
We added '--output-dir' just a few weeks ago, now it seems we want to use '--work-dir'. See: https://review.opendev.org/775302. Let's re-factor to use the common consistent working directory. Depends-On: https://review.opendev.org/780969 Change-Id: Ic903c6d1769d6a6a026208b9857680a115de6c31
This commit is contained in:
parent
2039e4b4b0
commit
3fc20a82b8
|
@ -352,7 +352,6 @@ class TestProvisionNode(fakes.TestOvercloudNode):
|
|||
'node_timeout': 3600,
|
||||
'concurrency': 20,
|
||||
'manage_network_ports': False,
|
||||
'output_dir': mock.ANY,
|
||||
'working_dir': mock.ANY,
|
||||
},
|
||||
inventory='localhost,',
|
||||
|
|
|
@ -256,15 +256,6 @@ class ProvisionNode(command.Command):
|
|||
help=_('Enable provisioning of network ports'),
|
||||
default=False,
|
||||
action="store_true")
|
||||
# TODO(hjensas): Remove 'output-dir' use common 'workdir' instead.
|
||||
# See: https://review.opendev.org/775302
|
||||
parser.add_argument('--output-dir',
|
||||
help=_('Directory to use for saved output. '
|
||||
'When not specified, '
|
||||
'$HOME/config-download/node-config will be '
|
||||
'used.'),
|
||||
action='store',
|
||||
default=None)
|
||||
parser.add_argument(
|
||||
'--working-dir', action='store',
|
||||
help=_('The working directory for the deployment where all '
|
||||
|
@ -278,9 +269,8 @@ class ProvisionNode(command.Command):
|
|||
self.log.debug("take_action(%s)" % parsed_args)
|
||||
|
||||
if not parsed_args.working_dir:
|
||||
working_dir = os.path.join(
|
||||
os.path.expanduser('~'),
|
||||
"overcloud-deploy-%s" % parsed_args.stack)
|
||||
working_dir = oooutils.get_default_working_dir(
|
||||
parsed_args.stack)
|
||||
else:
|
||||
working_dir = os.path.abspath(parsed_args.working_dir)
|
||||
oooutils.makedirs(working_dir)
|
||||
|
@ -293,11 +283,6 @@ class ProvisionNode(command.Command):
|
|||
ssh_key = fp.read()
|
||||
|
||||
output_path = os.path.abspath(parsed_args.output)
|
||||
if parsed_args.output_dir:
|
||||
output_dir = os.path.abspath(parsed_args.output_dir)
|
||||
else:
|
||||
output_dir = os.path.join(constants.DEFAULT_WORK_DIR,
|
||||
'node-config')
|
||||
|
||||
extra_vars = {
|
||||
"stack_name": parsed_args.stack,
|
||||
|
@ -309,7 +294,6 @@ class ProvisionNode(command.Command):
|
|||
"node_timeout": parsed_args.timeout,
|
||||
"concurrency": parsed_args.concurrency,
|
||||
"manage_network_ports": parsed_args.network_ports,
|
||||
"output_dir": output_dir,
|
||||
"working_dir": working_dir
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue