aboutsummaryrefslogtreecommitdiff
path: root/foreman_ansible_inventory.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-08-05 07:50:59 +0200
committerDaniel Lobato <elobatocs@gmail.com>2016-08-08 16:14:39 +0200
commit5cd9db77c4fa5fc61587f11f83db0c806ae72fa1 (patch)
treec6678b2f1e21bbc07a38f16d25f9fe132bc622d8 /foreman_ansible_inventory.py
parentaaac5ade66fb3345bcb6f3c3a979d596c91c602e (diff)
Only call ForemanInventory when __main__ is set
so we can run tools on it that import the module for analysis
Diffstat (limited to 'foreman_ansible_inventory.py')
-rwxr-xr-xforeman_ansible_inventory.py3
1 files changed, 2 insertions, 1 deletions
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()