From 34435d9ca2e35ff02651a5fe715fc36694ecb8b1 Mon Sep 17 00:00:00 2001 From: qtang Date: Wed, 13 Jul 2016 17:28:45 +0800 Subject: Exchange the check order for the dhcp and no-dhcp The dhcp is setting with True by default and progress always jump into the first if check. So the no-dhcp option always ignored there. Check the no-dhcp option first and then the dhcp option value to avoid this. Change-Id: Ide640e2cab3936d419ca62105304ff5d4a8a2074 Closes-Bug: #1602588 --- openstackclient/network/v2/subnet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'openstackclient/network') diff --git a/openstackclient/network/v2/subnet.py b/openstackclient/network/v2/subnet.py index 45d3442d..f26f6804 100644 --- a/openstackclient/network/v2/subnet.py +++ b/openstackclient/network/v2/subnet.py @@ -168,7 +168,7 @@ def _get_attrs(client_manager, parsed_args, is_create=True): attrs['allocation_pools'] = parsed_args.allocation_pools if parsed_args.dhcp: attrs['enable_dhcp'] = True - elif parsed_args.no_dhcp: + if parsed_args.no_dhcp: attrs['enable_dhcp'] = False if ('dns_nameservers' in parsed_args and parsed_args.dns_nameservers is not None): @@ -223,7 +223,6 @@ class CreateSubnet(command.ShowOne): dhcp_enable_group.add_argument( '--dhcp', action='store_true', - default=True, help=_("Enable DHCP (default)") ) dhcp_enable_group.add_argument( -- cgit v1.2.1