Skip to content

Commit 8d63bdb

Browse files
committed
Workaround for Ansible's run_command
1 parent ae48ea0 commit 8d63bdb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/augtool

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ def main():
101101
if module.check_mode:
102102
commands += "\nset /augeas/save noop"
103103
commands += "\nsave\nprint /augeas//error\n"
104-
status, out, err = module.run_command(cmd, data=commands)
104+
# binary_data=True is a workaround because otherwise run_command
105+
# will add r'\n' to stdin.
106+
# https://github.com/ansible/ansible/pull/6084
107+
status, out, err = module.run_command(cmd, data=commands, binary_data=True)
105108
if status != 0:
106109
module.fail_json(rc=status, msg="augtool errors:\n" + err)
107110
else:

0 commit comments

Comments
 (0)