1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

Repaired trailing ellipses when outputting primitive values on stdout

Merge branch 'python-sops' into bug/value.to.stdout

Repaired trailing ellipses when outputting primitive values on stdout
This commit is contained in:
Todd Wolfson
2016-11-02 13:45:59 -07:00
parent f10225368d
commit d6870992dd

View File

@@ -1278,10 +1278,13 @@ def write_file(tree, path=None, filetype=None):
fd = tempfile.NamedTemporaryFile(suffix="."+filetype, delete=False)
path = fd.name
if fd and not isinstance(tree, dict) and not isinstance(tree, list):
# Write the entire tree to file descriptor
fd.write(tree.encode('utf-8'))
fd.close()
if not isinstance(tree, dict) and not isinstance(tree, list):
if path == 'stdout':
sys.stdout.write(tree.encode('utf-8'))
else:
# Write the entire tree to file descriptor
fd.write(tree.encode('utf-8'))
fd.close()
return path
if filetype == "yaml":