Merge "Fix password file path message"
This commit is contained in:
commit
aa8618da4f
@ -3600,3 +3600,10 @@ def duplicate_param_check(user_environments):
|
||||
'Duplicate parameter defined. Key: "%s", Current Value: %s', k,
|
||||
yaml.dump(v, default_flow_style=False)
|
||||
)
|
||||
|
||||
|
||||
def get_output_dir(output_dir: str, stack_name: str = "undercloud") -> str:
|
||||
if not output_dir:
|
||||
return os.path.join(constants.UNDERCLOUD_OUTPUT_DIR,
|
||||
'tripleo-deploy', stack_name)
|
||||
return output_dir
|
||||
|
@ -1134,13 +1134,9 @@ class Deploy(command.Command):
|
||||
|
||||
self._run_preflight_checks(parsed_args)
|
||||
|
||||
# prepare working spaces
|
||||
if not parsed_args.output_dir:
|
||||
output_dir = os.path.join(constants.UNDERCLOUD_OUTPUT_DIR,
|
||||
'tripleo-deploy',
|
||||
parsed_args.stack)
|
||||
else:
|
||||
output_dir = parsed_args.output_dir
|
||||
output_dir = utils.get_output_dir(parsed_args.output_dir,
|
||||
parsed_args.stack)
|
||||
|
||||
self.output_dir = os.path.abspath(output_dir)
|
||||
self._create_working_dirs(parsed_args.stack.lower())
|
||||
# The state that needs to be persisted between serial deployments
|
||||
|
@ -141,6 +141,7 @@ class InstallUndercloud(command.Command):
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
output_dir = utils.get_output_dir(self.osloconfig.get('output_dir'))
|
||||
# Fetch configuration used to add logging to a file
|
||||
utils.load_config(self.osloconfig, constants.UNDERCLOUD_CONF_PATH)
|
||||
utils.configure_logging(self.log, self.app_args.verbose_level,
|
||||
@ -166,7 +167,7 @@ class InstallUndercloud(command.Command):
|
||||
subprocess.check_call(cmd)
|
||||
self.log.warning(UNDERCLOUD_COMPLETION_MESSAGE.format(
|
||||
os.path.join(
|
||||
constants.UNDERCLOUD_OUTPUT_DIR,
|
||||
output_dir,
|
||||
'tripleo-undercloud-passwords.yaml'
|
||||
),
|
||||
'~/stackrc'
|
||||
@ -213,6 +214,7 @@ class UpgradeUndercloud(InstallUndercloud):
|
||||
" ".join(cmd)))
|
||||
|
||||
def _run_upgrade(self, parsed_args):
|
||||
output_dir = utils.get_output_dir(self.osloconfig.get('output_dir'))
|
||||
cmd = undercloud_config.\
|
||||
prepare_undercloud_deploy(
|
||||
upgrade=True,
|
||||
@ -228,7 +230,7 @@ class UpgradeUndercloud(InstallUndercloud):
|
||||
self.log.warning(
|
||||
UNDERCLOUD_UPGRADE_COMPLETION_MESSAGE.format(
|
||||
os.path.join(
|
||||
constants.UNDERCLOUD_OUTPUT_DIR,
|
||||
output_dir,
|
||||
'tripleo-undercloud-passwords.yaml'
|
||||
),
|
||||
'~/stackrc'))
|
||||
|
@ -442,12 +442,8 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True,
|
||||
utils.configure_logging(LOG, verbose_level, CONF['undercloud_log_file'])
|
||||
_load_subnets_config_groups()
|
||||
|
||||
if not CONF.get('output_dir'):
|
||||
output_dir = os.path.join(constants.UNDERCLOUD_OUTPUT_DIR,
|
||||
'tripleo-deploy',
|
||||
'undercloud')
|
||||
else:
|
||||
output_dir = CONF['output_dir']
|
||||
output_dir = utils.get_output_dir(CONF['output_dir'])
|
||||
|
||||
# NOTE(bogdando): the generated env files are stored another path then
|
||||
# picked up later.
|
||||
# NOTE(aschultz): We copy this into the tht root that we save because
|
||||
|
@ -340,12 +340,10 @@ def _validate_passwords_file():
|
||||
old_passwd_path = None
|
||||
file_name = 'tripleo-undercloud-passwords.yaml'
|
||||
|
||||
if not CONF.get('output_dir'):
|
||||
output_dir = os.path.join(constants.UNDERCLOUD_OUTPUT_DIR,
|
||||
'tripleo-deploy', 'undercloud')
|
||||
else:
|
||||
output_dir = CONF['output_dir']
|
||||
old_passwd_path = os.path.join(output_dir, file_name)
|
||||
output_dir = utils.get_output_dir(CONF.get('output_dir'))
|
||||
|
||||
if CONF.get('output_dir'):
|
||||
old_passwd_path = os.path.join(CONF.get('output_dir'), file_name)
|
||||
|
||||
# If old_passwd_path is not yet set, then default to the old path
|
||||
if not old_passwd_path:
|
||||
|
Loading…
x
Reference in New Issue
Block a user