summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2016-01-25 15:20:31 -0500
committerKenny Woodson <kwoodson@redhat.com>2016-01-25 15:20:31 -0500
commitc5f51ce0365a037fb3c81674c61323f423047279 (patch)
tree33f33fe6c1ea3abd82b1a555c515214b215b263b /bin
parent00e52c75329b3a94313c210e1af165b5fcffa961 (diff)
downloadopenshift-c5f51ce0365a037fb3c81674c61323f423047279.tar.gz
openshift-c5f51ce0365a037fb3c81674c61323f423047279.tar.bz2
openshift-c5f51ce0365a037fb3c81674c61323f423047279.tar.xz
openshift-c5f51ce0365a037fb3c81674c61323f423047279.zip
Fixing awsutil to support aliases and v3
Diffstat (limited to 'bin')
-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), []))