Merge "Remove "baremetal show capabilities" command"
This commit is contained in:
commit
8f74280843
@ -58,7 +58,6 @@ openstack.tripleoclient.v1 =
|
||||
baremetal_instackenv_validate = tripleoclient.v1.baremetal:ValidateInstackEnv
|
||||
baremetal_import = tripleoclient.v1.baremetal:ImportBaremetal
|
||||
baremetal_introspection_bulk_start = tripleoclient.v1.baremetal:StartBaremetalIntrospectionBulk
|
||||
baremetal_show_capabilities = tripleoclient.v1.baremetal:ShowNodeCapabilities
|
||||
baremetal_introspection_bulk_status = tripleoclient.v1.baremetal:StatusBaremetalIntrospectionBulk
|
||||
baremetal_configure_ready_state = tripleoclient.v1.baremetal:ConfigureReadyState
|
||||
baremetal_configure_boot = tripleoclient.v1.baremetal:ConfigureBaremetalBoot
|
||||
|
@ -1044,33 +1044,3 @@ class TestConfigureBaremetalBoot(fakes.TestBaremetal):
|
||||
'tripleo.baremetal.v1.configure',
|
||||
workflow_input=self.workflow_input
|
||||
)
|
||||
|
||||
|
||||
class TestShowNodeCapabilities(fakes.TestBaremetal):
|
||||
|
||||
def setUp(self):
|
||||
super(TestShowNodeCapabilities, self).setUp()
|
||||
|
||||
# Get the command object to test
|
||||
self.cmd = baremetal.ShowNodeCapabilities(self.app, None)
|
||||
|
||||
def test_success(self):
|
||||
|
||||
bm_client = self.app.client_manager.baremetal
|
||||
|
||||
bm_client.node.list.return_value = [
|
||||
mock.Mock(uuid='UUID1'),
|
||||
mock.Mock(uuid='UUID2'),
|
||||
]
|
||||
|
||||
bm_client.node.get.return_value = mock.Mock(
|
||||
properties={'capabilities': 'boot_option:local'})
|
||||
|
||||
arglist = []
|
||||
parsed_args = self.check_parser(self.cmd, arglist, [])
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
self.assertEqual((
|
||||
('Node UUID', 'Node Capabilities'),
|
||||
[('UUID1', 'boot_option:local'), ('UUID2', 'boot_option:local')]
|
||||
), result)
|
||||
|
@ -428,21 +428,3 @@ class ConfigureBaremetalBoot(command.Command):
|
||||
overwrite_root_device_hints=(
|
||||
parsed_args.overwrite_root_device_hints)
|
||||
)
|
||||
|
||||
|
||||
class ShowNodeCapabilities(command.Lister):
|
||||
"""List the capabilities for all Nodes"""
|
||||
|
||||
log = logging.getLogger(__name__ + ".ShowNodeProfile")
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
self.log.warning('This command is deprecated and will be removed soon '
|
||||
'please use "openstack overcloud profiles list" to '
|
||||
'get the list of all nodes and their profiles')
|
||||
bm_client = self.app.client_manager.baremetal
|
||||
rows = []
|
||||
for node in bm_client.node.list():
|
||||
node_detail = bm_client.node.get(node.uuid)
|
||||
capabilities = node_detail.properties.get('capabilities')
|
||||
rows.append((node.uuid, capabilities))
|
||||
return (("Node UUID", "Node Capabilities"), rows, )
|
||||
|
Loading…
Reference in New Issue
Block a user