Merge "Add dns_publish_fixed_ip attribute to subnets"

This commit is contained in:
Zuul 2020-01-13 19:27:51 +00:00 committed by Gerrit Code Review
commit 08c57260e4
1 changed files with 26 additions and 0 deletions

View File

@ -230,6 +230,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
@ -303,6 +307,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>',
@ -558,6 +573,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>',