User can run lnst-ctl with parameter --dump-pools that will print
available machine pools based on config files.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst-ctl | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/lnst-ctl b/lnst-ctl
index bf97c1f..e6be46f 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -45,6 +45,8 @@ def usage(retval=0):
print " -d, --debug emit debugging messages"
print " --dump-config dumps the join of all loaded " \
"configuration files on stdout and exits"
+ print " --dump-pools dumps the available machine " \
+ "pools and exits"
print " -h, --help print this message"
print " -m, --no-colours disable coloured terminal output"
print " -o, --disable-pool-checks don't check the availability of
" \
@@ -203,7 +205,8 @@ def main():
"html=",
"multi-match",
"result=",
- "pools="
+ "pools=",
+ "dump-pools"
]
)
except getopt.GetoptError as err:
@@ -279,6 +282,8 @@ def main():
dump_config = True
elif opt in ("--pools"):
pools.extend(arg.split(","))
+ elif opt in ("--dump-pools"):
+ dump_pools = True
if xslt_url != None:
lnst_config.set_option("environment", "xslt_url", xslt_url)
@@ -287,6 +292,11 @@ def main():
print lnst_config.dump_config()
return RETVAL_PASS
+ if dump_pools:
+ for pool_name, pool_path in lnst_config.get_pools().items():
+ print pool_name + ' = ' + pool_path
+ return RETVAL_PASS
+
if coloured_output:
coloured_output = not lnst_config.get_option("colours",
"disable_colours")
--
2.4.3
Show replies by date