summaryrefslogtreecommitdiffstats
path: root/bin/openshift_ansible
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2016-01-04 11:44:50 -0500
committerKenny Woodson <kwoodson@redhat.com>2016-01-04 11:44:50 -0500
commit1a5319841b028d94294f683e407963742f340fe5 (patch)
tree08aa6aa833a3bf04cab1645b790bee1bc27ef6f3 /bin/openshift_ansible
parent265cd64555c9262f0896505caa6b036f6092dd0d (diff)
parentda8165469a43dc3bf43b2024a76edcd04be0bb81 (diff)
downloadopenshift-1a5319841b028d94294f683e407963742f340fe5.tar.gz
openshift-1a5319841b028d94294f683e407963742f340fe5.tar.bz2
openshift-1a5319841b028d94294f683e407963742f340fe5.tar.xz
openshift-1a5319841b028d94294f683e407963742f340fe5.zip
Merge pull request #958 from kwoodson/envfix
Fixing meta data tags env and environment
Diffstat (limited to 'bin/openshift_ansible')
-rw-r--r--bin/openshift_ansible/awsutil.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/bin/openshift_ansible/awsutil.py b/bin/openshift_ansible/awsutil.py
index 1ea2f914c..76b4f4f51 100644
--- a/bin/openshift_ansible/awsutil.py
+++ b/bin/openshift_ansible/awsutil.py
@@ -61,7 +61,7 @@ class AwsUtil(object):
def get_environments(self):
"""Searches for env tags in the inventory and returns all of the envs found."""
- pattern = re.compile(r'^tag_env_(.*)')
+ pattern = re.compile(r'^tag_environment_(.*)')
envs = []
inv = self.get_inventory()
@@ -109,13 +109,13 @@ class AwsUtil(object):
inst_by_env = {}
for _, host in inv['_meta']['hostvars'].items():
# If you don't have an environment tag, we're going to ignore you
- if 'ec2_tag_env' not in host:
+ if 'ec2_tag_environment' not in host:
continue
- if host['ec2_tag_env'] not in inst_by_env:
- inst_by_env[host['ec2_tag_env']] = {}
+ if host['ec2_tag_environment'] not in inst_by_env:
+ inst_by_env[host['ec2_tag_environment']] = {}
host_id = "%s:%s" % (host['ec2_tag_Name'], host['ec2_id'])
- inst_by_env[host['ec2_tag_env']][host_id] = host
+ inst_by_env[host['ec2_tag_environment']][host_id] = host
return inst_by_env
@@ -157,7 +157,7 @@ class AwsUtil(object):
def gen_env_tag(env):
"""Generate the environment tag
"""
- return "tag_env_%s" % env
+ return "tag_environment_%s" % env
def gen_host_type_tag(self, host_type):
"""Generate the host type tag
@@ -165,12 +165,6 @@ class AwsUtil(object):
host_type = self.resolve_host_type(host_type)
return "tag_host-type_%s" % host_type
- def gen_env_host_type_tag(self, host_type, env):
- """Generate the environment host type tag
- """
- host_type = self.resolve_host_type(host_type)
- return "tag_env-host-type_%s-%s" % (env, host_type)
-
def get_host_list(self, host_type=None, envs=None, version=None, cached=False):
"""Get the list of hosts from the inventory using host-type and environment
"""