diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2015-02-11 14:41:52 -0500 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2015-02-11 14:41:52 -0500 |
commit | 603c79412df1b141230ec55f032ad086ada37097 (patch) | |
tree | b7b219426d893ad7c18f8389793b4f7b929124d8 /bin/ansibleutil.py | |
parent | 7d368f62f06a37a92cf8d644842c338ba55b1d67 (diff) | |
download | openshift-603c79412df1b141230ec55f032ad086ada37097.tar.gz openshift-603c79412df1b141230ec55f032ad086ada37097.tar.bz2 openshift-603c79412df1b141230ec55f032ad086ada37097.tar.xz openshift-603c79412df1b141230ec55f032ad086ada37097.zip |
Checking in oscp.
Diffstat (limited to 'bin/ansibleutil.py')
-rw-r--r-- | bin/ansibleutil.py | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/bin/ansibleutil.py b/bin/ansibleutil.py index f5f699918..07e41b42c 100644 --- a/bin/ansibleutil.py +++ b/bin/ansibleutil.py @@ -5,6 +5,7 @@ import sys import os import json import re +import collections class AnsibleUtil(object): def __init__(self): @@ -53,7 +54,7 @@ class AnsibleUtil(object): return groups - def build_host_dict(self, args=[]): + def build_host_dict_by_env(self, args=[]): inv = self.get_inventory(args) inst_by_env = {} @@ -63,27 +64,5 @@ class AnsibleUtil(object): host_id = "%s:%s" % (host['ec2_tag_Name'],host['ec2_id']) inst_by_env[host['ec2_tag_environment']][host_id] = host - return inst_by_env - - def get_hostnames(self, args=[]): - inv = self.get_inventory(args) - - import collections - hostnames = collections.defaultdict(list) - - for dns, host in inv['_meta']['hostvars'].items(): - hostnames['ec2_tag_Name'].append(host['ec2_id']) - - return hostnames - - def get_host_ids(self, args=[]): - inv = self.get_inventory(args) - - ids = {} - - for dns, host in inv['_meta']['hostvars'].items(): - ids['ec2_id'] = host - - return ids |