Skip to content

Commit b4e9b22

Browse files
committed
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
1 parent 7549d26 commit b4e9b22

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

openstackclient/network/v2/subnet.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ def _get_attrs(client_manager, parsed_args, is_create=True):
229229
attrs['enable_dhcp'] = True
230230
if parsed_args.no_dhcp:
231231
attrs['enable_dhcp'] = False
232+
if parsed_args.dns_publish_fixed_ip:
233+
attrs['dns_publish_fixed_ip'] = True
234+
if parsed_args.no_dns_publish_fixed_ip:
235+
attrs['dns_publish_fixed_ip'] = False
232236
if ('dns_nameservers' in parsed_args and
233237
parsed_args.dns_nameservers is not None):
234238
attrs['dns_nameservers'] = parsed_args.dns_nameservers
@@ -302,6 +306,17 @@ def get_parser(self, prog_name):
302306
action='store_true',
303307
help=_("Disable DHCP")
304308
)
309+
dns_publish_fixed_ip_group = parser.add_mutually_exclusive_group()
310+
dns_publish_fixed_ip_group.add_argument(
311+
'--dns-publish-fixed-ip',
312+
action='store_true',
313+
help=_("Enable publishing fixed IPs in DNS")
314+
)
315+
dns_publish_fixed_ip_group.add_argument(
316+
'--no-dns-publish-fixed-ip',
317+
action='store_true',
318+
help=_("Disable publishing fixed IPs in DNS (default)")
319+
)
305320
parser.add_argument(
306321
'--gateway',
307322
metavar='<gateway>',
@@ -557,6 +572,17 @@ def get_parser(self, prog_name):
557572
action='store_true',
558573
help=_("Disable DHCP")
559574
)
575+
dns_publish_fixed_ip_group = parser.add_mutually_exclusive_group()
576+
dns_publish_fixed_ip_group.add_argument(
577+
'--dns-publish-fixed-ip',
578+
action='store_true',
579+
help=_("Enable publishing fixed IPs in DNS")
580+
)
581+
dns_publish_fixed_ip_group.add_argument(
582+
'--no-dns-publish-fixed-ip',
583+
action='store_true',
584+
help=_("Disable publishing fixed IPs in DNS")
585+
)
560586
parser.add_argument(
561587
'--gateway',
562588
metavar='<gateway>',

0 commit comments

Comments
 (0)