From 13e77fd7da6c1c176d3582f32b0f5b5b00ca32e8 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Sat, 10 Apr 2021 14:01:28 +0900 Subject: [PATCH] Append line-separator to the end of command line * Addresses issue #169 (https://github.com/ansible-collections/ansible.posix/issues/169) Signed-off-by: Hideki Saito --- changelogs/fragments/169_add_lineseparator_to_command.yml | 3 +++ plugins/modules/at.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/169_add_lineseparator_to_command.yml diff --git a/changelogs/fragments/169_add_lineseparator_to_command.yml b/changelogs/fragments/169_add_lineseparator_to_command.yml new file mode 100644 index 0000000000..9497ba560c --- /dev/null +++ b/changelogs/fragments/169_add_lineseparator_to_command.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - at - append line-separator to the end of the ``command`` (https://github.com/ansible-collections/ansible.posix/issues/169). diff --git a/plugins/modules/at.py b/plugins/modules/at.py index b29b35e5d7..a35ec4e98e 100644 --- a/plugins/modules/at.py +++ b/plugins/modules/at.py @@ -129,7 +129,7 @@ def get_matching_jobs(module, at_cmd, script_file): def create_tempfile(command): filed, script_file = tempfile.mkstemp(prefix='at') fileh = os.fdopen(filed, 'w') - fileh.write(command) + fileh.write(command + os.linesep) fileh.close() return script_file