Move yaml helpers to common module

Change-Id: I99ca47817b9d6913cd240d1533d68f74916a342c
diff --git a/src/com/mirantis/mcp/Common.groovy b/src/com/mirantis/mcp/Common.groovy
index cc48fdc..597809c 100644
--- a/src/com/mirantis/mcp/Common.groovy
+++ b/src/com/mirantis/mcp/Common.groovy
@@ -1,5 +1,8 @@
 package com.mirantis.mcp
 
+@Grab(group='org.yaml', module='snakeyaml', version='1.17')
+import org.yaml.snakeyaml.Yaml
+
 /**
  * https://issues.jenkins-ci.org/browse/JENKINS-26481
  * fix groovy List.collect()
@@ -32,6 +35,26 @@
 }
 
 /**
+ * Convert YAML document to Map object
+ * @param data YAML string
+ */
+@NonCPS
+def loadYAML(String data) {
+  def yaml = new Yaml()
+  return yaml.load(data)
+}
+
+/**
+ * Convert Map object to YAML string
+ * @param map Map object
+ */
+@NonCPS
+def dumpYAML(Map map) {
+  def yaml = new Yaml()
+  return yaml.dump(map)
+}
+
+/**
  * Run function on k8s cluster
  *
  * @param config LinkedHashMap