Skip to content

Commit 08c5726

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add dns_publish_fixed_ip attribute to subnets"
2 parents cf76a00 + b4e9b22 commit 08c5726

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
@@ -230,6 +230,10 @@ def _get_attrs(client_manager, parsed_args, is_create=True):
230230
attrs['enable_dhcp'] = True
231231
if parsed_args.no_dhcp:
232232
attrs['enable_dhcp'] = False
233+
if parsed_args.dns_publish_fixed_ip:
234+
attrs['dns_publish_fixed_ip'] = True
235+
if parsed_args.no_dns_publish_fixed_ip:
236+
attrs['dns_publish_fixed_ip'] = False
233237
if ('dns_nameservers' in parsed_args and
234238
parsed_args.dns_nameservers is not None):
235239
attrs['dns_nameservers'] = parsed_args.dns_nameservers
@@ -303,6 +307,17 @@ def get_parser(self, prog_name):
303307
action='store_true',
304308
help=_("Disable DHCP")
305309
)
310+
dns_publish_fixed_ip_group = parser.add_mutually_exclusive_group()
311+
dns_publish_fixed_ip_group.add_argument(
312+
'--dns-publish-fixed-ip',
313+
action='store_true',
314+
help=_("Enable publishing fixed IPs in DNS")
315+
)
316+
dns_publish_fixed_ip_group.add_argument(
317+
'--no-dns-publish-fixed-ip',
318+
action='store_true',
319+
help=_("Disable publishing fixed IPs in DNS (default)")
320+
)
306321
parser.add_argument(
307322
'--gateway',
308323
metavar='<gateway>',
@@ -558,6 +573,17 @@ def get_parser(self, prog_name):
558573
action='store_true',
559574
help=_("Disable DHCP")
560575
)
576+
dns_publish_fixed_ip_group = parser.add_mutually_exclusive_group()
577+
dns_publish_fixed_ip_group.add_argument(
578+
'--dns-publish-fixed-ip',
579+
action='store_true',
580+
help=_("Enable publishing fixed IPs in DNS")
581+
)
582+
dns_publish_fixed_ip_group.add_argument(
583+
'--no-dns-publish-fixed-ip',
584+
action='store_true',
585+
help=_("Disable publishing fixed IPs in DNS")
586+
)
561587
parser.add_argument(
562588
'--gateway',
563589
metavar='<gateway>',

0 commit comments

Comments
 (0)