diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index d02010254..62584b14f 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -30,7 +30,7 @@ MINION_LOG_FILE = "install-minion.log" UNDERCLOUD_ROLES_FILE = "roles_data_undercloud.yaml" STANDALONE_EPHEMERAL_STACK_VSTATE = '/var/lib/tripleo-heat-installer' UNDERCLOUD_LOG_FILE = "install-undercloud.log" -OVERCLOUD_NETWORKS_FILE = "network_data.yaml" +OVERCLOUD_NETWORKS_FILE = "network_data_default.yaml" OVERCLOUD_VIP_FILE = "vip_data_default.yaml" STANDALONE_NETWORKS_FILE = "/dev/null" UNDERCLOUD_NETWORKS_FILE = "network_data_undercloud.yaml" diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index 52871ec79..ae4ab74ec 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -1176,6 +1176,18 @@ class DeployOvercloud(command.Command): 'argument disables the protection, allowing the protected ' 'resource types to be override in the user environment.') ) + parser.add_argument( + '-y', '--yes', default=False, + action='store_true', + help=_('Use -y or --yes to skip any confirmation required before ' + 'the deploy operation. Use this with caution!') + ) + parser.add_argument( + '--allow-deprecated-network-data', default=False, + action='store_true', + help=_('Set this to allow using deprecated network data YAML ' + 'definition schema.') + ) return parser @@ -1184,6 +1196,19 @@ class DeployOvercloud(command.Command): logging.setup(CONF, '') self.log.debug("take_action(%s)" % parsed_args) + if (parsed_args.networks_file and + (not parsed_args.yes + and not parsed_args.allow_deprecated_network_data)): + if not utils.is_network_data_v2(parsed_args.networks_file): + confirm = utils.prompt_user_for_confirmation( + 'DEPRECATED network data definition {} provided. Please ' + 'update the network data definition to version 2.\n' + 'Do you still wish to continue with deployment [y/N]' + .format(parsed_args.networks_file), + self.log) + if not confirm: + raise oscexc.CommandError("Action not confirmed, exiting.") + if not parsed_args.working_dir: self.working_dir = utils.get_default_working_dir( parsed_args.stack) diff --git a/tripleoclient/v1/overcloud_update.py b/tripleoclient/v1/overcloud_update.py index b0574b28d..8f2d79a9b 100644 --- a/tripleoclient/v1/overcloud_update.py +++ b/tripleoclient/v1/overcloud_update.py @@ -43,12 +43,7 @@ class UpdatePrepare(DeployOvercloud): def get_parser(self, prog_name): parser = super(UpdatePrepare, self).get_parser(prog_name) - parser.add_argument('-y', '--yes', default=False, - action='store_true', - help=_("Use -y or --yes to skip the confirmation " - "required before any update operation. " - "Use this with caution! "), - ) + return parser def take_action(self, parsed_args): @@ -233,12 +228,6 @@ class UpdateConverge(DeployOvercloud): def get_parser(self, prog_name): parser = super(UpdateConverge, self).get_parser(prog_name) - parser.add_argument('-y', '--yes', default=False, - action='store_true', - help=_("Use -y or --yes to skip the confirmation " - "required before any update operation. " - "Use this with caution! "), - ) return parser diff --git a/tripleoclient/v1/overcloud_upgrade.py b/tripleoclient/v1/overcloud_upgrade.py index 74efb53e7..0c58943df 100644 --- a/tripleoclient/v1/overcloud_upgrade.py +++ b/tripleoclient/v1/overcloud_upgrade.py @@ -48,12 +48,7 @@ class UpgradePrepare(DeployOvercloud): def get_parser(self, prog_name): parser = super(UpgradePrepare, self).get_parser(prog_name) - parser.add_argument('-y', '--yes', default=False, - action='store_true', - help=_("Use -y or --yes to skip the confirmation " - "required before any upgrade " - "operation. Use this with caution! "), - ) + return parser def take_action(self, parsed_args):