Improve client master_count validation
Currently client rely master_count validation on server side, this is not good, the patch fix this. Also add unit test for invalid --master-count. Change-Id: Icf2b850f78989365814437e2c22c994c6ebc1fc1 Related-Bug: #1522668 Depends-On: I21109682358e125ae99326978eee73e09db476ba
This commit is contained in:
parent
e3a796aae6
commit
c8810bef54
@ -91,6 +91,12 @@ class ShellTest(shell_test_base.TestCommandLineArgument):
|
||||
self._mandatory_arg_error)
|
||||
self.assertFalse(mock_create.called)
|
||||
|
||||
@mock.patch('magnumclient.v1.bays.BayManager.create')
|
||||
def test_bay_create_failure_invalid_master_count(self, mock_create):
|
||||
self._test_arg_failure('bay-create --baymodel xxx --master-count test',
|
||||
self._invalid_value_error)
|
||||
self.assertFalse(mock_create.called)
|
||||
|
||||
@mock.patch('magnumclient.v1.bays.BayManager.delete')
|
||||
def test_bay_delete_success(self, mock_delete):
|
||||
self._test_arg_success('bay-delete xxx')
|
||||
|
@ -43,6 +43,7 @@ def do_bay_list(cs, args):
|
||||
help='The bay node count.')
|
||||
@utils.arg('--master-count',
|
||||
metavar='<master-count>',
|
||||
type=int,
|
||||
default=1,
|
||||
help='The number of master nodes for the bay.')
|
||||
@utils.arg('--discovery-url',
|
||||
|
Loading…
Reference in New Issue
Block a user