summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-07-19 10:59:39 +0000
committerGerrit Code Review <review@openstack.org>2016-07-19 10:59:40 +0000
commit33a40a08c29261fc913231324df435e4b3d48ca9 (patch)
treecc699094911bc2acba416067287c40ae99418470 /openstackclient
parentae2fd1a9aedacbc2f60554c99da128f0139f1098 (diff)
parent34435d9ca2e35ff02651a5fe715fc36694ecb8b1 (diff)
downloadpython-openstackclient-33a40a08c29261fc913231324df435e4b3d48ca9.tar.gz
Merge "Exchange the check order for the dhcp and no-dhcp"
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/network/v2/subnet.py3
-rw-r--r--openstackclient/tests/network/v2/test_subnet.py2
2 files changed, 1 insertions, 4 deletions
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(
diff --git a/openstackclient/tests/network/v2/test_subnet.py b/openstackclient/tests/network/v2/test_subnet.py
index 46af44fb..e24b49e8 100644
--- a/openstackclient/tests/network/v2/test_subnet.py
+++ b/openstackclient/tests/network/v2/test_subnet.py
@@ -236,7 +236,6 @@ class TestCreateSubnet(TestSubnet):
self.network.create_subnet.assert_called_once_with(**{
'cidr': self._subnet.cidr,
- 'enable_dhcp': self._subnet.enable_dhcp,
'ip_version': self._subnet.ip_version,
'name': self._subnet.name,
'network_id': self._subnet.network_id,
@@ -410,7 +409,6 @@ class TestCreateSubnet(TestSubnet):
self.network.create_subnet.assert_called_once_with(**{
'cidr': self._subnet.cidr,
- 'enable_dhcp': self._subnet.enable_dhcp,
'ip_version': self._subnet.ip_version,
'name': self._subnet.name,
'network_id': self._subnet.network_id,