]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
vminfo fix
authorMladen Uzunov <mladen.uzunov@digitaspixelpark.com>
Thu, 9 Jun 2022 09:19:04 +0000 (12:19 +0300)
committerMladen Uzunov <mladen.uzunov@digitaspixelpark.com>
Thu, 9 Jun 2022 09:19:04 +0000 (12:19 +0300)
bin/vminfo

index 4e64f29e7c7c9c81a219ed71affd0cce6dc6b152..b14b943c0b90fc1e1bd274f1ac2a95f5fc85e25c 100755 (executable)
@@ -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"]