Add ability to test model against Reclass source code
Related-bug: PROD-21847
Change-Id: I455e733ac7473d210c90261fefdf7dc2142e0b9b
diff --git a/src/com/mirantis/mk/Common.groovy b/src/com/mirantis/mk/Common.groovy
index 54eb85a..95a96c3 100644
--- a/src/com/mirantis/mk/Common.groovy
+++ b/src/com/mirantis/mk/Common.groovy
@@ -888,7 +888,7 @@
/**
* Ugly processing basic funcs with /etc/apt
- * @param configYaml
+ * @param configYaml YAML text or Map
* Example :
configYaml = '''
---
@@ -907,7 +907,12 @@
*/
def debianExtraRepos(configYaml) {
- def config = readYaml text: configYaml
+ def config = null
+ if (configYaml instanceof String) {
+ config = readYaml text: configYaml
+ } else {
+ config = configYaml
+ }
if (config.get('repo', false)) {
for (String repo in config['repo'].keySet()) {
source = config['repo'][repo]['source']