summaryrefslogtreecommitdiffstats
path: root/bin/ansibleutil.py
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2015-02-05 16:02:36 -0500
committerKenny Woodson <kwoodson@redhat.com>2015-02-05 16:02:36 -0500
commitee96928a2d1c21c5d2319418f4cf6ca774a3e010 (patch)
tree0472b4be53d3b93b34b8d0491949628d4baca8b0 /bin/ansibleutil.py
parent55b7f22404da7a0cfcdbce467e9581f6b8509320 (diff)
downloadopenshift-ee96928a2d1c21c5d2319418f4cf6ca774a3e010.tar.gz
openshift-ee96928a2d1c21c5d2319418f4cf6ca774a3e010.tar.bz2
openshift-ee96928a2d1c21c5d2319418f4cf6ca774a3e010.tar.xz
openshift-ee96928a2d1c21c5d2319418f4cf6ca774a3e010.zip
Attempting to only refresh cache when doing --list on ossh.
Diffstat (limited to 'bin/ansibleutil.py')
-rw-r--r--bin/ansibleutil.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/ansibleutil.py b/bin/ansibleutil.py
index ed35ef8f9..6df3e7126 100644
--- a/bin/ansibleutil.py
+++ b/bin/ansibleutil.py
@@ -11,8 +11,12 @@ class AnsibleUtil(object):
self.file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
self.multi_ec2_path = os.path.realpath(os.path.join(self.file_path, '..','inventory','multi_ec2.py'))
- def get_inventory(self):
+ def get_inventory(self,args=[]):
cmd = [self.multi_ec2_path]
+
+ if args:
+ cmd.extend(args)
+
env = {}
p = subprocess.Popen(cmd, stderr=subprocess.PIPE,
stdout=subprocess.PIPE, env=env)
@@ -50,8 +54,8 @@ class AnsibleUtil(object):
return groups
- def build_host_dict(self):
- inv = self.get_inventory()
+ def build_host_dict(self, args=[]):
+ inv = self.get_inventory(args)
inst_by_env = {}
for dns, host in inv['_meta']['hostvars'].items():