From 03d932ea0b3074187bfcdd9c0422a968f5f56c59 Mon Sep 17 00:00:00 2001 From: reedip Date: Fri, 8 Apr 2016 11:41:33 +0900 Subject: Append existing information during subnet set Existing values of --dns-nameserver, --allocation-pool and --houst-routes is currently overwritten when a user executes 'port set', but actually that data should be appended. This patch fixes the issue. Closes-Bug: #1564447 Change-Id: I3dba9afa68d869abb3960b55a6880401a10eebf7 --- openstackclient/network/v2/subnet.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'openstackclient/network') diff --git a/openstackclient/network/v2/subnet.py b/openstackclient/network/v2/subnet.py index 10e5859a..45e68235 100644 --- a/openstackclient/network/v2/subnet.py +++ b/openstackclient/network/v2/subnet.py @@ -366,6 +366,12 @@ class SetSubnet(command.Command): if not attrs: msg = "Nothing specified to be set" raise exceptions.CommandError(msg) + if 'dns_nameservers' in attrs: + attrs['dns_nameservers'] += obj.dns_nameservers + if 'host_routes' in attrs: + attrs['host_routes'] += obj.host_routes + if 'allocation_pools' in attrs: + attrs['allocation_pools'] += obj.allocation_pools client.update_subnet(obj, **attrs) return -- cgit v1.2.1