summaryrefslogtreecommitdiffstats
path: root/roles/openshift_aws/filter_plugins/openshift_aws_filters.py
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-11-08 18:20:46 -0500
committerKenny Woodson <kwoodson@redhat.com>2017-11-29 21:22:39 -0500
commit6154f7d49847813dfdea9ad73aaaed86f18aa9de (patch)
tree50d571bb23627660e3f31854f513d9a044cc2178 /roles/openshift_aws/filter_plugins/openshift_aws_filters.py
parent6b6b422245be79dd3eec0c93a58875c646bbfba7 (diff)
downloadopenshift-6154f7d49847813dfdea9ad73aaaed86f18aa9de.tar.gz
openshift-6154f7d49847813dfdea9ad73aaaed86f18aa9de.tar.bz2
openshift-6154f7d49847813dfdea9ad73aaaed86f18aa9de.tar.xz
openshift-6154f7d49847813dfdea9ad73aaaed86f18aa9de.zip
Initial upgrade for scale groups.
Diffstat (limited to 'roles/openshift_aws/filter_plugins/openshift_aws_filters.py')
-rw-r--r--roles/openshift_aws/filter_plugins/openshift_aws_filters.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/roles/openshift_aws/filter_plugins/openshift_aws_filters.py b/roles/openshift_aws/filter_plugins/openshift_aws_filters.py
index a9893c0a7..e707abd3f 100644
--- a/roles/openshift_aws/filter_plugins/openshift_aws_filters.py
+++ b/roles/openshift_aws/filter_plugins/openshift_aws_filters.py
@@ -9,6 +9,18 @@ class FilterModule(object):
''' Custom ansible filters for use by openshift_aws role'''
@staticmethod
+ def scale_groups_match_capacity(scale_group_info):
+ ''' This function will verify that the scale group instance count matches
+ the scale group desired capacity
+
+ '''
+ for scale_group in scale_group_info:
+ if scale_group['desired_capacity'] != len(scale_group['instances']):
+ return False
+
+ return True
+
+ @staticmethod
def build_instance_tags(clusterid):
''' This function will return a dictionary of the instance tags.
@@ -25,4 +37,5 @@ class FilterModule(object):
def filters(self):
''' returns a mapping of filters to methods '''
- return {'build_instance_tags': self.build_instance_tags}
+ return {'build_instance_tags': self.build_instance_tags,
+ 'scale_groups_match_capacity': self.scale_groups_match_capacity}