From cecf1a77377b87ea6e3c36e30c9664f7b79dc309 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Mon, 18 Aug 2014 05:41:58 -0600 Subject: [PATCH] Network use enable/disable vs admin state up/down Use --enable and --disable vs --admin-state-up/--admin-state-down Change-Id: I90040b925cb537a8ba13d1dd609c51bb669cf149 --- openstackclient/network/v2/network.py | 29 +++++++++++-------- .../tests/network/v2/test_network.py | 8 ++--- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index 24d7197619..63411d55d5 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -43,13 +43,16 @@ class CreateNetwork(show.ShowOne): help='Name of network to create') admin_group = parser.add_mutually_exclusive_group() admin_group.add_argument( - '--admin-state-up', - dest='admin_state', action='store_true', - default=True, help='Set Admin State Up') + '--enable', + dest='admin_state', + default=True, + action='store_true', + help='Set administrative state up') admin_group.add_argument( - '--admin-state-down', - dest='admin_state', action='store_false', - help='Set Admin State Down') + '--disable', + dest='admin_state', + action='store_false', + help='Set administrative state down') share_group = parser.add_mutually_exclusive_group() share_group.add_argument( '--share', @@ -171,14 +174,16 @@ class SetNetwork(command.Command): ) admin_group = parser.add_mutually_exclusive_group() admin_group.add_argument( - '--admin-state-up', - dest='admin_state', action='store_true', + '--enable', + dest='admin_state', default=None, - help='Set Admin State Up') + action='store_true', + help='Set administrative state up') admin_group.add_argument( - '--admin-state-down', - dest='admin_state', action='store_false', - help='Set Admin State Down') + '--disable', + dest='admin_state', + action='store_false', + help='Set administrative state down') parser.add_argument( '--name', metavar='', diff --git a/openstackclient/tests/network/v2/test_network.py b/openstackclient/tests/network/v2/test_network.py index 08b61a0a2c..468db5e039 100644 --- a/openstackclient/tests/network/v2/test_network.py +++ b/openstackclient/tests/network/v2/test_network.py @@ -61,7 +61,7 @@ class TestCreateNetwork(common.TestNetworkBase): def test_create_all_options(self): arglist = [ - "--admin-state-down", + "--disable", "--share", FAKE_NAME, ] + self.given_show_options @@ -88,7 +88,7 @@ class TestCreateNetwork(common.TestNetworkBase): def test_create_other_options(self): arglist = [ - "--admin-state-up", + "--enable", "--no-share", FAKE_NAME, ] @@ -220,7 +220,7 @@ class TestSetNetwork(common.TestNetworkBase): def test_set_this(self): arglist = [ FAKE_NAME, - '--admin-state-up', + '--enable', '--name', 'noob', '--share', ] @@ -247,7 +247,7 @@ class TestSetNetwork(common.TestNetworkBase): def test_set_that(self): arglist = [ FAKE_NAME, - '--admin-state-down', + '--disable', '--no-share', ] verifylist = [