From: Mladen Uzunov Date: Thu, 9 Jun 2022 09:19:04 +0000 (+0300) Subject: vminfo fix X-Git-Tag: 1.6.1~1^2 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=cd0f3f45b6114b9811c0ce00adabf54e2351a7db;p=pixelpark%2Fcreate-terraform.git vminfo fix --- 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"]