This replaces the 'list' action from the original
implementation. We're going to list more than just hosts
over time, so a more specific name is warranted.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/lcitool | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/guests/lcitool b/guests/lcitool
index e90a33b..f11b92e 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -243,7 +243,8 @@ class Application:
formatter_class = argparse.RawDescriptionHelpFormatter,
description = "libvirt CI guest management tool",
epilog = textwrap.dedent("""
- supported actions:
+ informational actions:
+ hosts list all known hosts
"""),
)
self._parser.add_argument(
@@ -253,6 +254,10 @@ class Application:
help = "action to perform (see below)",
)
+ def _action_list(self):
+ for host in self._inventory.expand_pattern("all"):
+ print(host)
+
def run(self):
cmdline = self._parser.parse_args()
action = cmdline.a
--
2.17.1