Support domain names in networks

This commit is contained in:
2018-09-28 20:42:24 -04:00
parent 5d35adb4fc
commit 63d48a3821
2 changed files with 28 additions and 9 deletions

View File

@ -581,7 +581,12 @@ def cli_network():
@click.option(
'-d', '--description', 'description',
default="",
help='Description of the network. Should not contain whitespace.'
help='Description of the network; should not contain whitespace.'
)
@click.option(
'-n', '--domain', 'domain',
required=True,
help='Domain name of the network.'
)
@click.option(
'-i', '--ipnet', 'ip_network',
@ -602,16 +607,16 @@ def cli_network():
@click.argument(
'vni'
)
def net_add(vni, description, ip_network, ip_gateway, dhcp_flag):
def net_add(vni, description, domain, ip_network, ip_gateway, dhcp_flag):
"""
Add a new virtual network with VXLAN identifier VNI to the cluster.
Example:
pvc network add 1001 --ipnet 10.1.1.0/24 --gateway 10.1.1.1 --dhcp
pvc network add 1001 --domain test.local --ipnet 10.1.1.0/24 --gateway 10.1.1.1 --dhcp
"""
zk_conn = pvc_common.startZKConnection(zk_host)
retcode, retmsg = pvc_network.add_network(zk_conn, vni, description, ip_network, ip_gateway, dhcp_flag)
retcode, retmsg = pvc_network.add_network(zk_conn, vni, description, domain, ip_network, ip_gateway, dhcp_flag)
cleanup(retcode, retmsg, zk_conn)
###############################################################################
@ -621,7 +626,7 @@ def net_add(vni, description, ip_network, ip_gateway, dhcp_flag):
@click.option(
'-d', '--description', 'description',
default=None,
help='Description of the network. Should not contain whitespace.'
help='Description of the network; should not contain whitespace.'
)
@click.option(
'-i', '--ipnet', 'ip_network',
@ -735,7 +740,7 @@ def net_dhcp():
@click.option(
'-d', '--description', 'description',
default=None,
help='Description of the DHCP reservation; defaults to MACADDR if unspecified. Should not contain whitespace.'
help='Description of the DHCP reservation; defaults to MACADDR if unspecified; should not contain whitespace.'
)
@click.argument(
'net'