diff --git a/Makefile.am b/Makefile.am index 0d90702dff152a1dea721a439cc5161a6cf2209e..b1e8ee9dea32d186185d41562cc2687a47e6a689 100644 --- a/Makefile.am +++ b/Makefile.am @@ -263,6 +263,7 @@ pkgpython_PYTHON = \ lib/storage.py \ lib/uidpool.py \ lib/vcluster.py \ + lib/network.py \ lib/workerpool.py client_PYTHON = \ @@ -274,6 +275,7 @@ client_PYTHON = \ lib/client/gnt_instance.py \ lib/client/gnt_job.py \ lib/client/gnt_node.py \ + lib/client/gnt_network.py \ lib/client/gnt_os.py hypervisor_PYTHON = \ @@ -591,6 +593,7 @@ gnt_scripts = \ scripts/gnt-group \ scripts/gnt-instance \ scripts/gnt-job \ + scripts/gnt-network \ scripts/gnt-node \ scripts/gnt-os @@ -796,6 +799,7 @@ man_MANS = \ man/gnt-cluster.8 \ man/gnt-debug.8 \ man/gnt-group.8 \ + man/gnt-network.8 \ man/gnt-instance.8 \ man/gnt-job.8 \ man/gnt-node.8 \ diff --git a/autotools/build-bash-completion b/autotools/build-bash-completion index 511f521994ea92812e8c1c826b32ad3c8285aeff..c48430003e727010969085be304bea962ae5dc5f 100755 --- a/autotools/build-bash-completion +++ b/autotools/build-bash-completion @@ -135,6 +135,15 @@ def WritePreamble(sw, support_debug): sw.DecIndent() 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> # Result variable: $first_arg_idx sw.Write("_ganeti_find_first_arg() {") @@ -352,6 +361,8 @@ class CompletionWriter: WriteCompReply(sw, "-W \"$(_ganeti_iallocator)\"", cur=cur) elif suggest == cli.OPT_COMPL_ONE_NODEGROUP: 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: sw.Write("local tmp= node1= pfx= curvalue=\"${optcur#*:}\"") @@ -450,6 +461,8 @@ class CompletionWriter: choices = "$(_ganeti_nodes)" elif isinstance(arg, cli.ArgGroup): choices = "$(_ganeti_nodegroup)" + elif isinstance(arg, cli.ArgNetwork): + choices = "$(_ganeti_network)" elif isinstance(arg, cli.ArgJobId): choices = "$(_ganeti_jobs)" elif isinstance(arg, cli.ArgOs):