Moved pretty-printing to own function
Change-Id: I641fed7801975b04dcfc36b773d0f3b5900afb0d
diff --git a/src/com/mirantis/mk/Common.groovy b/src/com/mirantis/mk/Common.groovy
index b8e9756..fe82185 100644
--- a/src/com/mirantis/mk/Common.groovy
+++ b/src/com/mirantis/mk/Common.groovy
@@ -1,5 +1,7 @@
package com.mirantis.mk
+import static groovy.json.JsonOutput.prettyPrint
+import static groovy.json.JsonOutput.toJson
/**
*
* Common functions
@@ -87,6 +89,15 @@
}
/**
+ * Return pretty-printed string representation of given item
+ * @param item item to be pretty-printed (list, map, whatever)
+ * @return pretty-printed string
+ */
+def prettyPrint(item){
+ return prettyPrint(toJson(item)).replace('\\n', System.getProperty('line.separator'))
+}
+
+/**
* Print informational message
*
* @param msg