Deprecate --network-ports, enable it by default
The argument to enable disable node port management
when provisioning or unprovisioning baremetal nodes can
be enabled by default.
It is needed to have an ansible inventory generated,
which is required for whole-disk-image growpart execution
in change: I085ab9da30e1e1a7d2b9a9f230dd0275bd40480d.
Growpart should always run.
Conflicts:
tripleoclient/v1/overcloud_deploy.py
Change-Id: Ia0df205ea568f089c7cb7e5464bde76d294f4c36
(cherry picked from commit b3bcf63fa5)
This commit is contained in:
@@ -1531,7 +1531,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
'ssh_public_keys': 'sekrit',
|
||||
'ssh_user_name': 'heat-admin',
|
||||
'ssh_private_key_file': self.tmp_dir.join('id_rsa.pub'),
|
||||
'manage_network_ports': False,
|
||||
'manage_network_ports': True,
|
||||
'configure_networking': False,
|
||||
'working_dir': self.tmp_dir.join('working_dir'),
|
||||
'templates': constants.TRIPLEO_HEAT_TEMPLATES,
|
||||
@@ -1550,7 +1550,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
{'count': 3, 'name': 'Controller'}
|
||||
],
|
||||
'prompt': False,
|
||||
'manage_network_ports': False,
|
||||
'manage_network_ports': True,
|
||||
},
|
||||
inventory='localhost,',
|
||||
playbook='cli-overcloud-node-unprovision.yaml',
|
||||
|
||||
@@ -351,7 +351,7 @@ class TestProvisionNode(fakes.TestOvercloudNode):
|
||||
'ssh_private_key_file': key_file_name,
|
||||
'node_timeout': 3600,
|
||||
'concurrency': 20,
|
||||
'manage_network_ports': False,
|
||||
'manage_network_ports': True,
|
||||
'configure_networking': False,
|
||||
'working_dir': mock.ANY,
|
||||
'templates': constants.TRIPLEO_HEAT_TEMPLATES,
|
||||
@@ -406,7 +406,7 @@ class TestUnprovisionNode(fakes.TestOvercloudNode):
|
||||
'all': True,
|
||||
'prompt': True,
|
||||
'unprovision_confirm': unprovision_confirm,
|
||||
'manage_network_ports': False,
|
||||
'manage_network_ports': True,
|
||||
},
|
||||
inventory='localhost,',
|
||||
playbook='cli-overcloud-node-unprovision.yaml',
|
||||
|
||||
@@ -547,11 +547,11 @@ class DeployOvercloud(command.Command):
|
||||
"Error: --config-download-only/--setup-only must not be "
|
||||
"used when using --baremetal-deployment")
|
||||
|
||||
if ((parsed_args.network_ports or parsed_args.network_config)
|
||||
if (parsed_args.network_config
|
||||
and not parsed_args.baremetal_deployment):
|
||||
raise oscexc.CommandError(
|
||||
"Error: --baremetal-deployment must be used when using "
|
||||
"--network-ports or --network-config")
|
||||
"--network-config")
|
||||
|
||||
if parsed_args.environment_directories:
|
||||
self._validate_args_environment_directory(
|
||||
@@ -607,8 +607,7 @@ class DeployOvercloud(command.Command):
|
||||
"ssh_private_key_file": key,
|
||||
"ssh_public_keys": ssh_key,
|
||||
"ssh_user_name": parsed_args.overcloud_ssh_user,
|
||||
"manage_network_ports": (parsed_args.network_ports
|
||||
or parsed_args.network_config),
|
||||
"manage_network_ports": True,
|
||||
"configure_networking": parsed_args.network_config,
|
||||
"working_dir": self.working_dir,
|
||||
"templates": parsed_args.templates,
|
||||
@@ -650,8 +649,7 @@ class DeployOvercloud(command.Command):
|
||||
"stack_name": parsed_args.stack,
|
||||
"baremetal_deployment": roles,
|
||||
"prompt": False,
|
||||
"manage_network_ports": (parsed_args.network_ports
|
||||
or parsed_args.network_config),
|
||||
"manage_network_ports": True,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1041,10 +1039,6 @@ class DeployOvercloud(command.Command):
|
||||
metavar='<baremetal_deployment.yaml>',
|
||||
help=_('Configuration file describing the '
|
||||
'baremetal deployment'))
|
||||
parser.add_argument('--network-ports',
|
||||
help=_('Enable provisioning of network ports'),
|
||||
default=False,
|
||||
action="store_true")
|
||||
parser.add_argument('--network-config',
|
||||
help=_('Apply network config to provisioned '
|
||||
'nodes. (Implies "--network-ports")'),
|
||||
|
||||
@@ -253,7 +253,9 @@ class ProvisionNode(command.Command):
|
||||
help=_('Number of seconds to wait for the node '
|
||||
'provision to complete. (default=3600)'))
|
||||
parser.add_argument('--network-ports',
|
||||
help=_('Enable provisioning of network ports'),
|
||||
help=_('DEPRECATED! Network ports will always be '
|
||||
'provisioned.\n'
|
||||
'Enable provisioning of network ports'),
|
||||
default=False,
|
||||
action="store_true")
|
||||
parser.add_argument('--network-config',
|
||||
@@ -277,6 +279,11 @@ class ProvisionNode(command.Command):
|
||||
def take_action(self, parsed_args):
|
||||
self.log.debug("take_action(%s)" % parsed_args)
|
||||
|
||||
if parsed_args.network_ports:
|
||||
self.log.warning('DEPRECATED option "--network-ports" detected. '
|
||||
'This option is no longer used, network ports '
|
||||
'are always managed.')
|
||||
|
||||
if not parsed_args.working_dir:
|
||||
working_dir = oooutils.get_default_working_dir(
|
||||
parsed_args.stack)
|
||||
@@ -306,8 +313,7 @@ class ProvisionNode(command.Command):
|
||||
"ssh_user_name": parsed_args.overcloud_ssh_user,
|
||||
"node_timeout": parsed_args.timeout,
|
||||
"concurrency": parsed_args.concurrency,
|
||||
"manage_network_ports": (parsed_args.network_ports
|
||||
or parsed_args.network_config),
|
||||
"manage_network_ports": True,
|
||||
"configure_networking": parsed_args.network_config,
|
||||
"working_dir": working_dir,
|
||||
"templates": parsed_args.templates,
|
||||
@@ -357,7 +363,9 @@ class UnprovisionNode(command.Command):
|
||||
help=_('Configuration file describing the '
|
||||
'baremetal deployment'))
|
||||
parser.add_argument('--network-ports',
|
||||
help=_('Enable unprovisioning of network ports'),
|
||||
help=_('DEPRECATED! Network ports will always be '
|
||||
'unprovisioned.\n'
|
||||
'Enable unprovisioning of network ports'),
|
||||
default=False,
|
||||
action="store_true")
|
||||
return parser
|
||||
@@ -365,6 +373,11 @@ class UnprovisionNode(command.Command):
|
||||
def take_action(self, parsed_args):
|
||||
self.log.debug("take_action(%s)" % parsed_args)
|
||||
|
||||
if parsed_args.network_ports:
|
||||
self.log.warning('DEPRECATED option "--network-ports" detected. '
|
||||
'This option is no longer used, network ports '
|
||||
'are always managed.')
|
||||
|
||||
with open(parsed_args.input, 'r') as fp:
|
||||
roles = yaml.safe_load(fp)
|
||||
|
||||
@@ -384,7 +397,7 @@ class UnprovisionNode(command.Command):
|
||||
"all": parsed_args.all,
|
||||
"prompt": True,
|
||||
"unprovision_confirm": unprovision_confirm,
|
||||
"manage_network_ports": parsed_args.network_ports,
|
||||
"manage_network_ports": True,
|
||||
}
|
||||
)
|
||||
with open(unprovision_confirm) as f:
|
||||
|
||||
Reference in New Issue
Block a user