Merge "Add '--network-ports' option to node (un)provision"

changes/02/693502/55
Zuul 2 years ago committed by Gerrit Code Review
commit d7b14f7e1c

@ -361,7 +361,8 @@ class TestProvisionNode(fakes.TestOvercloudNode):
'ssh_public_keys': 'I am a key',
'ssh_user_name': 'heat-admin',
'node_timeout': 3600,
'concurrency': 20
'concurrency': 20,
'manage_network_ports': False,
},
inventory='localhost,',
playbook='cli-overcloud-node-provision.yaml',
@ -412,7 +413,8 @@ class TestUnprovisionNode(fakes.TestOvercloudNode):
],
'all': True,
'prompt': True,
'unprovision_confirm': unprovision_confirm
'unprovision_confirm': unprovision_confirm,
'manage_network_ports': False,
},
inventory='localhost,',
playbook='cli-overcloud-node-unprovision.yaml',
@ -428,7 +430,8 @@ class TestUnprovisionNode(fakes.TestOvercloudNode):
{'name': 'Controller'}
],
'all': True,
'prompt': False
'prompt': False,
'manage_network_ports': False,
},
inventory='localhost,',
playbook='cli-overcloud-node-unprovision.yaml',

@ -252,6 +252,10 @@ class ProvisionNode(command.Command):
default=3600,
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'),
default=False,
action="store_true")
return parser
def take_action(self, parsed_args):
@ -273,7 +277,8 @@ class ProvisionNode(command.Command):
"ssh_public_keys": ssh_key,
"ssh_user_name": parsed_args.overcloud_ssh_user,
"node_timeout": parsed_args.timeout,
"concurrency": parsed_args.concurrency
"concurrency": parsed_args.concurrency,
"manage_network_ports": parsed_args.network_ports
}
with oooutils.TempDirs() as tmp:
@ -315,6 +320,10 @@ class UnprovisionNode(command.Command):
metavar='<baremetal_deployment.yaml>',
help=_('Configuration file describing the '
'baremetal deployment'))
parser.add_argument('--network-ports',
help=_('Enable unprovisioning of network ports'),
default=False,
action="store_true")
return parser
def take_action(self, parsed_args):
@ -338,7 +347,8 @@ class UnprovisionNode(command.Command):
"baremetal_deployment": roles,
"all": parsed_args.all,
"prompt": True,
"unprovision_confirm": unprovision_confirm
"unprovision_confirm": unprovision_confirm,
"manage_network_ports": parsed_args.network_ports,
}
)
with open(unprovision_confirm) as f:
@ -366,6 +376,7 @@ class UnprovisionNode(command.Command):
"baremetal_deployment": roles,
"all": parsed_args.all,
"prompt": False,
"manage_network_ports": parsed_args.network_ports,
}
)

Loading…
Cancel
Save