fix yaml version issue with config yaml dump (#75344)

now tests can run in other pythons (really yaml pkg versions)
  also cleaned up diff_failure for unimplemented flow
pull/75394/head
Brian Coca 3 years ago committed by GitHub
parent 549d258c30
commit 22aa6dedc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -274,7 +274,7 @@ class ConfigCLI(CLI):
if subkey == 'env': if subkey == 'env':
data.append('%s%s=%s' % (prefix, entry, default)) data.append('%s%s=%s' % (prefix, entry, default))
elif subkey == 'vars': elif subkey == 'vars':
data.append(prefix + to_text(yaml.dump({entry: default}, Dumper=AnsibleDumper), errors='surrogate_or_strict')) data.append(prefix + to_text(yaml.dump({entry: default}, Dumper=AnsibleDumper, default_flow_style=False), errors='surrogate_or_strict'))
data.append('') data.append('')
return data return data

@ -1,4 +1 @@
shippable/posix/group1 shippable/posix/group1
skip/python2
skip/python3.6
skip/python3.7

@ -31,15 +31,9 @@ cleanup() {
trap 'cleanup' EXIT trap 'cleanup' EXIT
diff_failure() {
if [[ $INIT = 0 ]]; then
echo "FAILURE...diff mismatch!"
exit 1
fi
}
# check a-c init per format # check a-c init per format
for format in "vars" "ini" "env" for format in "vars" "ini" "env"
do do
ANSIBLE_LOOKUP_PLUGINS=./ ansible-config init types -t lookup -f "${format}" > "files/types.new.${format}" ANSIBLE_LOOKUP_PLUGINS=./ ansible-config init types -t lookup -f "${format}" > "files/types.new.${format}"
diff -u "files/types.${format}" "files/types.new.${format}"|| diff_failure diff -u "files/types.${format}" "files/types.new.${format}"
done done

Loading…
Cancel
Save