add getFileContent function
Change-Id: I2463f90f00f846a15dd6c93f5d098a37cd450146
diff --git a/src/com/mirantis/mk/Salt.groovy b/src/com/mirantis/mk/Salt.groovy
index 9668c1d..6180f99 100644
--- a/src/com/mirantis/mk/Salt.groovy
+++ b/src/com/mirantis/mk/Salt.groovy
@@ -388,3 +388,17 @@
common.errorMsg("Cannot print salt command result, given result is null")
}
}
+
+
+/**
+ * Return content of file target
+ *
+ * @param master Salt master object
+ * @param target Compound target (should target only one host)
+ * @param file File path to read (/etc/hosts for example)
+ */
+
+def getFileContent(master, target, file) {
+ result = cmdRun(master, target, "cat ${file}")
+ return result['return'][0].values()[0]
+}