Commit 4e4b6b7a authored by Apollon Oikonomopoulos's avatar Apollon Oikonomopoulos Committed by Iustin Pop

Include networks in Makefile and bash completion

Signed-off-by: default avatarApollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent a04cc7a4
...@@ -263,6 +263,7 @@ pkgpython_PYTHON = \ ...@@ -263,6 +263,7 @@ pkgpython_PYTHON = \
lib/storage.py \ lib/storage.py \
lib/uidpool.py \ lib/uidpool.py \
lib/vcluster.py \ lib/vcluster.py \
lib/network.py \
lib/workerpool.py lib/workerpool.py
client_PYTHON = \ client_PYTHON = \
...@@ -274,6 +275,7 @@ client_PYTHON = \ ...@@ -274,6 +275,7 @@ client_PYTHON = \
lib/client/gnt_instance.py \ lib/client/gnt_instance.py \
lib/client/gnt_job.py \ lib/client/gnt_job.py \
lib/client/gnt_node.py \ lib/client/gnt_node.py \
lib/client/gnt_network.py \
lib/client/gnt_os.py lib/client/gnt_os.py
hypervisor_PYTHON = \ hypervisor_PYTHON = \
...@@ -591,6 +593,7 @@ gnt_scripts = \ ...@@ -591,6 +593,7 @@ gnt_scripts = \
scripts/gnt-group \ scripts/gnt-group \
scripts/gnt-instance \ scripts/gnt-instance \
scripts/gnt-job \ scripts/gnt-job \
scripts/gnt-network \
scripts/gnt-node \ scripts/gnt-node \
scripts/gnt-os scripts/gnt-os
...@@ -796,6 +799,7 @@ man_MANS = \ ...@@ -796,6 +799,7 @@ man_MANS = \
man/gnt-cluster.8 \ man/gnt-cluster.8 \
man/gnt-debug.8 \ man/gnt-debug.8 \
man/gnt-group.8 \ man/gnt-group.8 \
man/gnt-network.8 \
man/gnt-instance.8 \ man/gnt-instance.8 \
man/gnt-job.8 \ man/gnt-job.8 \
man/gnt-node.8 \ man/gnt-node.8 \
......
...@@ -135,6 +135,15 @@ def WritePreamble(sw, support_debug): ...@@ -135,6 +135,15 @@ def WritePreamble(sw, support_debug):
sw.DecIndent() sw.DecIndent()
sw.Write("}") sw.Write("}")
sw.Write("_ganeti_network() {")
sw.IncIndent()
try:
networks_path = os.path.join(pathutils.DATA_DIR, "ssconf_networks")
sw.Write("cat %s 2>/dev/null || :", utils.ShellQuote(networks_path))
finally:
sw.DecIndent()
sw.Write("}")
# Params: <offset> <options with values> <options without values> # Params: <offset> <options with values> <options without values>
# Result variable: $first_arg_idx # Result variable: $first_arg_idx
sw.Write("_ganeti_find_first_arg() {") sw.Write("_ganeti_find_first_arg() {")
...@@ -352,6 +361,8 @@ class CompletionWriter: ...@@ -352,6 +361,8 @@ class CompletionWriter:
WriteCompReply(sw, "-W \"$(_ganeti_iallocator)\"", cur=cur) WriteCompReply(sw, "-W \"$(_ganeti_iallocator)\"", cur=cur)
elif suggest == cli.OPT_COMPL_ONE_NODEGROUP: elif suggest == cli.OPT_COMPL_ONE_NODEGROUP:
WriteCompReply(sw, "-W \"$(_ganeti_nodegroup)\"", cur=cur) WriteCompReply(sw, "-W \"$(_ganeti_nodegroup)\"", cur=cur)
elif suggest == cli.OPT_COMPL_ONE_NETWORK:
WriteCompReply(sw, "-W \"$(_ganeti_network)\"", cur=cur)
elif suggest == cli.OPT_COMPL_INST_ADD_NODES: elif suggest == cli.OPT_COMPL_INST_ADD_NODES:
sw.Write("local tmp= node1= pfx= curvalue=\"${optcur#*:}\"") sw.Write("local tmp= node1= pfx= curvalue=\"${optcur#*:}\"")
...@@ -450,6 +461,8 @@ class CompletionWriter: ...@@ -450,6 +461,8 @@ class CompletionWriter:
choices = "$(_ganeti_nodes)" choices = "$(_ganeti_nodes)"
elif isinstance(arg, cli.ArgGroup): elif isinstance(arg, cli.ArgGroup):
choices = "$(_ganeti_nodegroup)" choices = "$(_ganeti_nodegroup)"
elif isinstance(arg, cli.ArgNetwork):
choices = "$(_ganeti_network)"
elif isinstance(arg, cli.ArgJobId): elif isinstance(arg, cli.ArgJobId):
choices = "$(_ganeti_jobs)" choices = "$(_ganeti_jobs)"
elif isinstance(arg, cli.ArgOs): elif isinstance(arg, cli.ArgOs):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment