Added function for retrieving heat stacks by status
Change-Id: I76a118be04e82e2380ef98b1084bfc4fe7d9d139
diff --git a/src/com/mirantis/mk/Openstack.groovy b/src/com/mirantis/mk/Openstack.groovy
index 1cf5d57..9dfcc55 100644
--- a/src/com/mirantis/mk/Openstack.groovy
+++ b/src/com/mirantis/mk/Openstack.groovy
@@ -188,6 +188,18 @@
}
/**
+ * Get list of stack names with given stack status
+ *
+ * @param env Connection parameters for OpenStack API endpoint
+ * @param status Stack status
+ * @param path Optional path to the custom virtualenv
+ */
+ def getStacksWithStatus(client, status, path = null) {
+ cmd = 'heat stack-list -f stack_status='+status+' | awk \'NR>3 {print $4}\' | sed \'$ d\''
+ return runOpenstackCommand(cmd, client, path).trim().tokenize("\n")
+ }
+
+/**
* Get life cycle status for existing OpenStack Heat stack
*
* @param env Connection parameters for OpenStack API endpoint