Skip to content

Commit

Permalink
Merge pull request doublescoring#4 from ezh/master
Browse files Browse the repository at this point in the history
Add compatibility with Python YAML parser
  • Loading branch information
ezh committed Apr 19, 2017
2 parents d0031ad + 625b56d commit 9c6f21c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/groovy/salt.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ String getMapBlock(Map map, int level) {
def key = keys[iKey]
def value = map[key]
if (Map.isAssignableFrom(value.getClass())) {
output = output + " " * level + "'$key':\n" + getMapBlock(value, level + 1)
output = output + " " * level + "$key:\n" + getMapBlock(value, level + 1)
} else if (Collection.isAssignableFrom(value.getClass()) || Object[].isAssignableFrom(value.getClass())) {
output = output + " " * level + "'$key':\n" + getArrayBlock(value, level + 1)
output = output + " " * level + "$key:\n" + getArrayBlock(value, level + 1)
} else {
output = output + " " * level + "'$key':" + value
output = output + " " * level + "$key:" + value
}
output = output + "\n"
iKey++
Expand Down
2 changes: 1 addition & 1 deletion src/test/groovy/saltTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class saltTest {
//print("\n" + map1 + "\n")
//def map2 = shell.evaluate("script.generateConfig(['a': ['c': 'd', collection: [1,2,[kk: [bb: 'dd']]]]]);")
//print("\n" + map2 + "\n")
def map3 = shell.evaluate("script.generateConfig(['file_roots': ['base': ['a', 'b', 'c']], 'pillar_roots': ['base': ['e', 'f', 'g']]]);")
def map3 = shell.evaluate("script.generateConfig([file_roots: [base: ['a', 'b', 'c']], pillar_roots: [base: ['e', 'f', 'g']]]);")
print("\n" + map3 + "\n")
}

Expand Down

0 comments on commit 9c6f21c

Please sign in to comment.