diff options
| author | Zuul <zuul@review.openstack.org> | 2019-03-26 21:24:11 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-03-26 21:24:11 +0000 |
| commit | 487b748f84da13c4564c48d0093dffc1c53c4efe (patch) | |
| tree | d1a14b5d30c76c7bd9e2457a0dc66752ab76b6e9 /openstackclient/network | |
| parent | b90a5d07fe1f15a09acaccbeeaec2e2d6fb96f65 (diff) | |
| parent | 8fe45571b925bc6481c33fab7ccc6071f66f3c4f (diff) | |
| download | python-openstackclient-487b748f84da13c4564c48d0093dffc1c53c4efe.tar.gz | |
Merge "Fix service discovery in functional tests" into stable/stein
Diffstat (limited to 'openstackclient/network')
| -rw-r--r-- | openstackclient/network/v2/subnet.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/openstackclient/network/v2/subnet.py b/openstackclient/network/v2/subnet.py index 5f8113bb..0733f37c 100644 --- a/openstackclient/network/v2/subnet.py +++ b/openstackclient/network/v2/subnet.py @@ -681,29 +681,30 @@ class UnsetSubnet(command.Command): def take_action(self, parsed_args): client = self.app.client_manager.network obj = client.find_subnet(parsed_args.subnet, ignore_missing=False) - tmp_obj = copy.deepcopy(obj) + attrs = {} if parsed_args.dns_nameservers: - _update_arguments(tmp_obj.dns_nameservers, + attrs['dns_nameservers'] = copy.deepcopy(obj.dns_nameservers) + _update_arguments(attrs['dns_nameservers'], parsed_args.dns_nameservers, 'dns-nameserver') - attrs['dns_nameservers'] = tmp_obj.dns_nameservers if parsed_args.host_routes: + attrs['host_routes'] = copy.deepcopy(obj.host_routes) _update_arguments( - tmp_obj.host_routes, + attrs['host_routes'], convert_entries_to_nexthop(parsed_args.host_routes), 'host-route') - attrs['host_routes'] = tmp_obj.host_routes if parsed_args.allocation_pools: - _update_arguments(tmp_obj.allocation_pools, + attrs['allocation_pools'] = copy.deepcopy(obj.allocation_pools) + _update_arguments(attrs['allocation_pools'], parsed_args.allocation_pools, 'allocation-pool') - attrs['allocation_pools'] = tmp_obj.allocation_pools + if parsed_args.service_types: - _update_arguments(tmp_obj.service_types, + attrs['service_types'] = copy.deepcopy(obj.service_types) + _update_arguments(attrs['service_types'], parsed_args.service_types, 'service-type') - attrs['service_types'] = tmp_obj.service_types if attrs: client.update_subnet(obj, **attrs) |
