From 0d060a185f756163e7ad6a5c8773fcf5a31add90 Mon Sep 17 00:00:00 2001 From: Alex Trevino Date: Mon, 20 Feb 2017 15:19:05 -0500 Subject: [PATCH] Allow ec2.py to be imported (#21637) --- contrib/inventory/ec2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index c16e770259c..de549d29bdf 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -1567,5 +1567,6 @@ class Ec2Inventory(object): return json.dumps(data) -# Run the script -Ec2Inventory() +if __name__ == '__main__': + # Run the script + Ec2Inventory()