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