summaryrefslogtreecommitdiffstats
path: root/bin/openshift_ansible
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2016-01-25 15:26:08 -0500
committerKenny Woodson <kwoodson@redhat.com>2016-01-25 15:26:08 -0500
commit001098c79341ccb65e7a0dead43e596866d0deb5 (patch)
treed6000b591d4d2b2c7e0f452114e8a60cbaa070a0 /bin/openshift_ansible
parentf927d44a46bd8c31addaf38f6ac2afd85d7b464a (diff)
parentc5f51ce0365a037fb3c81674c61323f423047279 (diff)
downloadopenshift-001098c79341ccb65e7a0dead43e596866d0deb5.tar.gz
openshift-001098c79341ccb65e7a0dead43e596866d0deb5.tar.bz2
openshift-001098c79341ccb65e7a0dead43e596866d0deb5.tar.xz
openshift-001098c79341ccb65e7a0dead43e596866d0deb5.zip
Merge pull request #1269 from kwoodson/inventory_alias_fix
Supporting awsutil inventory calls with version and hosttype aliases.
Diffstat (limited to 'bin/openshift_ansible')
-rw-r--r--bin/openshift_ansible/awsutil.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/openshift_ansible/awsutil.py b/bin/openshift_ansible/awsutil.py
index e03c0ab15..3639ef733 100644
--- a/bin/openshift_ansible/awsutil.py
+++ b/bin/openshift_ansible/awsutil.py
@@ -89,7 +89,7 @@ class AwsUtil(object):
def get_host_types(self):
"""Searches for host-type tags in the inventory and returns all host-types found."""
- pattern = re.compile(r'^oo_host-type_(.*)')
+ pattern = re.compile(r'^oo_hosttype_(.*)')
host_types = []
inv = self.get_inventory()
@@ -177,19 +177,20 @@ class AwsUtil(object):
def gen_clusterid_tag(clu):
"""Generate the clusterid tag
"""
- return "tag_clusterid_%s" % clu
+ return "oo_clusterid_%s" % clu
@staticmethod
def gen_env_tag(env):
"""Generate the environment tag
"""
- return "tag_environment_%s" % env
+ return "oo_environment_%s" % env
- def gen_host_type_tag(self, host_type):
+ def gen_host_type_tag(self, host_type, version):
"""Generate the host type tag
"""
- host_type = self.resolve_host_type(host_type)
- return "tag_host-type_%s" % host_type
+ if version == '2':
+ host_type = self.resolve_host_type(host_type)
+ return "oo_hosttype_%s" % host_type
# This function uses all of these params to perform a filters on our host inventory.
# pylint: disable=too-many-arguments
@@ -226,7 +227,7 @@ class AwsUtil(object):
retval.intersection_update(env_hosts)
if host_type:
- retval.intersection_update(inv.get(self.gen_host_type_tag(host_type), []))
+ retval.intersection_update(inv.get(self.gen_host_type_tag(host_type, version), []))
if version != 'all':
retval.intersection_update(inv.get(AwsUtil.gen_version_tag(version), []))