From 5f45b18f3616c9e6e027698913405ff9e6dc1a59 Mon Sep 17 00:00:00 2001 From: Dustin Schoenbrun Date: Wed, 12 Aug 2015 11:38:39 -0400 Subject: [PATCH] Make spec_driver_handles_share_servers required This change makes the extra spec "spec_driver_handles_share_servers" required for the type-create command in the Manila Client as opposed to being listed as an optional argument that was in fact required. I had to remove a no longer valid test case in the unit test suite, but it was done because instead of throwing an exception, the argparser will just exit(2). Change-Id: I0dc58cdfe10493a8eb736fa1bd0cd196bb0f5c05 Closes-Bug: #1484156 --- manilaclient/tests/unit/v1/test_shell.py | 7 ------- manilaclient/v1/shell.py | 5 ++--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/manilaclient/tests/unit/v1/test_shell.py b/manilaclient/tests/unit/v1/test_shell.py index 3c4bfe21e..493462086 100644 --- a/manilaclient/tests/unit/v1/test_shell.py +++ b/manilaclient/tests/unit/v1/test_shell.py @@ -497,13 +497,6 @@ class ShellTest(test_utils.TestCase): cliutils.print_list.assert_called_once_with( mock.ANY, ['ID', 'Name', 'all_extra_specs'], mock.ANY) - def test_type_create_without_required_extra_spec(self): - self.assertRaises( - exceptions.CommandError, - self.run_command, - 'type-create test', - ) - @ddt.data('fake', 'FFFalse', 'trueee') def test_type_create_invalid_extra_spec(self, extra_spec): self.assertRaises( diff --git a/manilaclient/v1/shell.py b/manilaclient/v1/shell.py index 7a83a7196..b49cc9d8a 100644 --- a/manilaclient/v1/shell.py +++ b/manilaclient/v1/shell.py @@ -1838,10 +1838,9 @@ def do_extra_specs_list(cs, args): @cliutils.arg( 'spec_driver_handles_share_servers', metavar='', - default='', - nargs='?', + type=str, help="Required extra specification. " - "Valid values 'true'/'1' and 'false'/'0'") + "Valid values are 'true'/'1' and 'false'/'0'") @cliutils.arg( '--is_public', '--is-public',