summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-05-31 11:48:04 +0000
committerGerrit Code Review <review@openstack.org>2017-05-31 11:48:04 +0000
commit1bd1acd32c9537f74ccfe7a501745aa96fd1f83a (patch)
tree1c765368101c85396547adf16b2527e1694c3900
parent930b1dc284ae431f4cf4cdc6a5af9e809ad560f5 (diff)
parent8cd130c71c500b923d6ae1d864245c661b583a94 (diff)
Merge "Remove "baremetal show capabilities" command" into stable/newton
-rw-r--r--setup.cfg1
-rw-r--r--tripleoclient/tests/v1/baremetal/test_baremetal.py30
-rw-r--r--tripleoclient/v1/baremetal.py18
3 files changed, 0 insertions, 49 deletions
diff --git a/setup.cfg b/setup.cfg
index b72e990..5da1b6c 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -58,7 +58,6 @@ openstack.tripleoclient.v1 =
58 baremetal_instackenv_validate = tripleoclient.v1.baremetal:ValidateInstackEnv 58 baremetal_instackenv_validate = tripleoclient.v1.baremetal:ValidateInstackEnv
59 baremetal_import = tripleoclient.v1.baremetal:ImportBaremetal 59 baremetal_import = tripleoclient.v1.baremetal:ImportBaremetal
60 baremetal_introspection_bulk_start = tripleoclient.v1.baremetal:StartBaremetalIntrospectionBulk 60 baremetal_introspection_bulk_start = tripleoclient.v1.baremetal:StartBaremetalIntrospectionBulk
61 baremetal_show_capabilities = tripleoclient.v1.baremetal:ShowNodeCapabilities
62 baremetal_introspection_bulk_status = tripleoclient.v1.baremetal:StatusBaremetalIntrospectionBulk 61 baremetal_introspection_bulk_status = tripleoclient.v1.baremetal:StatusBaremetalIntrospectionBulk
63 baremetal_configure_ready_state = tripleoclient.v1.baremetal:ConfigureReadyState 62 baremetal_configure_ready_state = tripleoclient.v1.baremetal:ConfigureReadyState
64 baremetal_configure_boot = tripleoclient.v1.baremetal:ConfigureBaremetalBoot 63 baremetal_configure_boot = tripleoclient.v1.baremetal:ConfigureBaremetalBoot
diff --git a/tripleoclient/tests/v1/baremetal/test_baremetal.py b/tripleoclient/tests/v1/baremetal/test_baremetal.py
index 185472b..aaf84e3 100644
--- a/tripleoclient/tests/v1/baremetal/test_baremetal.py
+++ b/tripleoclient/tests/v1/baremetal/test_baremetal.py
@@ -1044,33 +1044,3 @@ class TestConfigureBaremetalBoot(fakes.TestBaremetal):
1044 'tripleo.baremetal.v1.configure', 1044 'tripleo.baremetal.v1.configure',
1045 workflow_input=self.workflow_input 1045 workflow_input=self.workflow_input
1046 ) 1046 )
1047
1048
1049class TestShowNodeCapabilities(fakes.TestBaremetal):
1050
1051 def setUp(self):
1052 super(TestShowNodeCapabilities, self).setUp()
1053
1054 # Get the command object to test
1055 self.cmd = baremetal.ShowNodeCapabilities(self.app, None)
1056
1057 def test_success(self):
1058
1059 bm_client = self.app.client_manager.baremetal
1060
1061 bm_client.node.list.return_value = [
1062 mock.Mock(uuid='UUID1'),
1063 mock.Mock(uuid='UUID2'),
1064 ]
1065
1066 bm_client.node.get.return_value = mock.Mock(
1067 properties={'capabilities': 'boot_option:local'})
1068
1069 arglist = []
1070 parsed_args = self.check_parser(self.cmd, arglist, [])
1071 result = self.cmd.take_action(parsed_args)
1072
1073 self.assertEqual((
1074 ('Node UUID', 'Node Capabilities'),
1075 [('UUID1', 'boot_option:local'), ('UUID2', 'boot_option:local')]
1076 ), result)
diff --git a/tripleoclient/v1/baremetal.py b/tripleoclient/v1/baremetal.py
index 71f9d3b..fb90f69 100644
--- a/tripleoclient/v1/baremetal.py
+++ b/tripleoclient/v1/baremetal.py
@@ -422,21 +422,3 @@ class ConfigureBaremetalBoot(command.Command):
422 overwrite_root_device_hints=( 422 overwrite_root_device_hints=(
423 parsed_args.overwrite_root_device_hints) 423 parsed_args.overwrite_root_device_hints)
424 ) 424 )
425
426
427class ShowNodeCapabilities(command.Lister):
428 """List the capabilities for all Nodes"""
429
430 log = logging.getLogger(__name__ + ".ShowNodeProfile")
431
432 def take_action(self, parsed_args):
433 self.log.warning('This command is deprecated and will be removed soon '
434 'please use "openstack overcloud profiles list" to '
435 'get the list of all nodes and their profiles')
436 bm_client = self.app.client_manager.baremetal
437 rows = []
438 for node in bm_client.node.list():
439 node_detail = bm_client.node.get(node.uuid)
440 capabilities = node_detail.properties.get('capabilities')
441 rows.append((node.uuid, capabilities))
442 return (("Node UUID", "Node Capabilities"), rows, )