OSC 'node list' recognizes all provision states

Now OSC 'node list' command with --provision-state argument for
'available' will list all nodes whose provision state is 'available'.
It will also accept all the provision-states for OSC 'node list'
command.

Change-Id: If0032f652bcb3f6638b59dba32b97cb19176df46
Closes-Bug: #1663202
This commit is contained in:
M V P Nitesh 2017-02-09 19:22:23 +05:30
parent 9a67f1a316
commit d55e363904
3 changed files with 5 additions and 15 deletions

View File

@ -564,9 +564,7 @@ class ListBaremetalNode(command.Lister):
'--provision-state', '--provision-state',
dest='provision_state', dest='provision_state',
metavar='<provision state>', metavar='<provision state>',
choices=self.PROVISION_STATES, help=_("List nodes in specified provision state."))
help=_("Limit list to nodes in <provision state>. One of %s.") %
(", ".join(self.PROVISION_STATES)))
parser.add_argument( parser.add_argument(
'--resource-class', '--resource-class',
dest='resource_class', dest='resource_class',

View File

@ -778,18 +778,6 @@ class TestBaremetalList(TestBaremetal):
**kwargs **kwargs
) )
def test_baremetal_list_invalid_provision_state(self):
arglist = [
'--provision-state', 'invalid',
]
verifylist = [
('provision_state', 'invalid'),
]
self.assertRaises(oscutils.ParserException,
self.check_parser,
self.cmd, arglist, verifylist)
def test_baremetal_list_resource_class(self): def test_baremetal_list_resource_class(self):
arglist = [ arglist = [
'--resource-class', 'foo', '--resource-class', 'foo',

View File

@ -0,0 +1,4 @@
---
fixes:
- Allows all provision states for OSC node list
command with --provision-state argument