From 5cd9db77c4fa5fc61587f11f83db0c806ae72fa1 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 5 Aug 2016 07:50:59 +0200 Subject: Only call ForemanInventory when __main__ is set so we can run tools on it that import the module for analysis --- foreman_ansible_inventory.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'foreman_ansible_inventory.py') diff --git a/foreman_ansible_inventory.py b/foreman_ansible_inventory.py index e42aeb3..8af920c 100755 --- a/foreman_ansible_inventory.py +++ b/foreman_ansible_inventory.py @@ -336,5 +336,6 @@ class ForemanInventory(object): else: return json.dumps(data) -ForemanInventory() +if __name__ == '__main__': + ForemanInventory() -- cgit v1.2.3