Added parseJSON function to common
Change-Id: I55fff0d2e9aa6cd5d504e4ce9bb9f90949d23b98
diff --git a/src/com/mirantis/mk/Common.groovy b/src/com/mirantis/mk/Common.groovy
index fe82185..8da0f3e 100644
--- a/src/com/mirantis/mk/Common.groovy
+++ b/src/com/mirantis/mk/Common.groovy
@@ -396,3 +396,15 @@
return false
}
}
+
+/**
+ * Parse JSON string to hashmap
+ * @param jsonString input JSON string
+ * @return created hashmap
+ */
+def parseJSON(jsonString){
+ def m = [:]
+ def lazyMap = new JsonSlurper().parseText(output)
+ m.putAll(lazyMap)
+ return m
+}