add countHashMapEquals to common
This function will be used for checking aws instances states.
Change-Id: I7f573ac3e46c49a77747d381659969c63ff7c7b0
diff --git a/src/com/mirantis/mk/Aws.groovy b/src/com/mirantis/mk/Aws.groovy
index 669305d..2c9405a 100644
--- a/src/com/mirantis/mk/Aws.groovy
+++ b/src/com/mirantis/mk/Aws.groovy
@@ -135,7 +135,6 @@
*
*/
-@NonCPS
def describeAutoscalingGroup(venv_path, env_vars, group_name) {
def python = new com.mirantis.mk.Python()
def common = new com.mirantis.mk.Common()
@@ -168,7 +167,6 @@
}
}
-@NonCPS
def waitForAutoscalingInstances(venv_path, env_vars, group_name, max_timeout = 600, loop_sleep = 20) {
def aws = new com.mirantis.mk.Aws()
def common = new com.mirantis.mk.Common()
@@ -182,7 +180,7 @@
def instances = out['AutoScalingGroups'][0]['Instances']
// check all instances are InService
- if (instances.stream().filter{i -> !i['LifecycleState'].equals("InService")}.collect(java.util.stream.Collectors.counting()) == 0) {
+ if (common.countHashMapEquals(instances, 'LifecycleState', 'InService') == 0) {
break
}
@@ -199,7 +197,6 @@
*
*/
-
def registerIntanceWithLb(venv_path, env_vars, lb, instances = []) {
def python = new com.mirantis.mk.Python()
@@ -221,7 +218,3 @@
return out
}
}
-
-
-
-