diff options
| author | Jens Harbott <j.harbott@x-ion.de> | 2019-09-03 17:36:56 +0000 |
|---|---|---|
| committer | Jens Harbott (frickler) <j.harbott@x-ion.de> | 2019-09-11 08:33:16 +0000 |
| commit | b4e9b225b4435a7a3598b70617c1e6eb73613fa0 (patch) | |
| tree | 0a2de581b1d6b91e9c60ca64e72b13d98a1a5df3 /openstackclient | |
| parent | 7549d260aa8724f2104a84cfb2cbd88e24b4778c (diff) | |
| download | python-openstackclient-b4e9b225b4435a7a3598b70617c1e6eb73613fa0.tar.gz | |
Add dns_publish_fixed_ip attribute to subnets
With the subnet_dns_publish_fixed_ip extension Neutron has added a new
attribute to subnets, allowing to select whether DNS records should be
published for fixed IPs from that subnet. Add support for this when
creating and updating subnets.
[0] https://bugs.launchpad.net/neutron/+bug/1784879
[1] https://review.opendev.org/662405
[2] https://review.opendev.org/662409
Depends-On: https://review.opendev.org/679833
Change-Id: Ia804e878acfd1f05e1f00c2ac9202c1d260827f4
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/network/v2/subnet.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/openstackclient/network/v2/subnet.py b/openstackclient/network/v2/subnet.py index 1f0c2d94..60994aca 100644 --- a/openstackclient/network/v2/subnet.py +++ b/openstackclient/network/v2/subnet.py @@ -229,6 +229,10 @@ def _get_attrs(client_manager, parsed_args, is_create=True): attrs['enable_dhcp'] = True if parsed_args.no_dhcp: attrs['enable_dhcp'] = False + if parsed_args.dns_publish_fixed_ip: + attrs['dns_publish_fixed_ip'] = True + if parsed_args.no_dns_publish_fixed_ip: + attrs['dns_publish_fixed_ip'] = False if ('dns_nameservers' in parsed_args and parsed_args.dns_nameservers is not None): attrs['dns_nameservers'] = parsed_args.dns_nameservers @@ -302,6 +306,17 @@ class CreateSubnet(command.ShowOne): action='store_true', help=_("Disable DHCP") ) + dns_publish_fixed_ip_group = parser.add_mutually_exclusive_group() + dns_publish_fixed_ip_group.add_argument( + '--dns-publish-fixed-ip', + action='store_true', + help=_("Enable publishing fixed IPs in DNS") + ) + dns_publish_fixed_ip_group.add_argument( + '--no-dns-publish-fixed-ip', + action='store_true', + help=_("Disable publishing fixed IPs in DNS (default)") + ) parser.add_argument( '--gateway', metavar='<gateway>', @@ -557,6 +572,17 @@ class SetSubnet(command.Command): action='store_true', help=_("Disable DHCP") ) + dns_publish_fixed_ip_group = parser.add_mutually_exclusive_group() + dns_publish_fixed_ip_group.add_argument( + '--dns-publish-fixed-ip', + action='store_true', + help=_("Enable publishing fixed IPs in DNS") + ) + dns_publish_fixed_ip_group.add_argument( + '--no-dns-publish-fixed-ip', + action='store_true', + help=_("Disable publishing fixed IPs in DNS") + ) parser.add_argument( '--gateway', metavar='<gateway>', |
