Merge "Deprecate network data v1 definition"

This commit is contained in:
Zuul 2021-09-24 20:09:06 +00:00 committed by Gerrit Code Review
commit 81c049a8de
4 changed files with 28 additions and 19 deletions

View File

@ -31,7 +31,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"

View File

@ -1040,6 +1040,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
@ -1048,6 +1060,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)

View File

@ -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

View File

@ -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):