[libvirt] [jenkins-ci PATCH v2 05/12] lcitool: Implement the 'hosts' action

Andrea Bolognani abologna at redhat.com
Thu Jul 12 15:19:22 UTC 2018


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 at 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




More information about the libvir-list mailing list