Deprecate network data v1 definition

Change the constant OVERCLOUD_NETWORKS_FILE to point
to network_data_default.yaml in THT. (The new v2 default).

Add check, and prompt the user for confirmation in case
legacy networks definition is provided. The check and prompt
can be disabled with the '--allow-deprecated-network-data'
argument.

Also add the '--yes' in 'OvercloudDeploy' and remove it in the
Update nad Upgrade classes that will now inherit it.

blueprint network-data-v2
Depends-On: I618c0a0d99c934fb65a6af30bc76096d52d4679d
Depends-On: I759402fb22a9a3fd0fc06c8e107eee6eb5798c51
Change-Id: I2d14d9e587fce28ea0897bb235c9dedc8f68fa12
This commit is contained in:
Harald Jensås 2021-06-29 10:30:21 +02:00
parent 4f426292d9
commit 13a9ced063
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):