From cd0f3f45b6114b9811c0ce00adabf54e2351a7db Mon Sep 17 00:00:00 2001 From: Mladen Uzunov Date: Thu, 9 Jun 2022 12:19:04 +0300 Subject: [PATCH] vminfo fix --- bin/vminfo | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/vminfo b/bin/vminfo index 4e64f29..b14b943 100755 --- a/bin/vminfo +++ b/bin/vminfo @@ -29,6 +29,10 @@ class FactGetter: "pp_purpose", "r10k_environment", ] + if not len(self.facts) > 1: + print("[Error] The host is either incorrect or it does not exists in PuppetDB!") + _exit(1) + for fact in self.facts: try: if fact["name"] in fields: @@ -36,6 +40,7 @@ class FactGetter: except TypeError: print("[Error] The host is either incorrect or it does not exists in PuppetDB!") _exit(1) + for key in data.keys(): del data[key]["certname"] del data[key]["environment"] -- 2.39.5