diff --git a/changelogs/fragments/reboot-unicode-string.yaml b/changelogs/fragments/reboot-unicode-string.yaml new file mode 100644 index 00000000000..5ac36b924bd --- /dev/null +++ b/changelogs/fragments/reboot-unicode-string.yaml @@ -0,0 +1,3 @@ +bugfixes: + - reboot - use unicode instead of bytes for stdout and stderr to match the + type returned from low_level_execute() diff --git a/lib/ansible/plugins/action/reboot.py b/lib/ansible/plugins/action/reboot.py index 4dd90149a50..a440ff3875b 100644 --- a/lib/ansible/plugins/action/reboot.py +++ b/lib/ansible/plugins/action/reboot.py @@ -94,8 +94,8 @@ class ActionModule(ActionBase): return reboot_command def get_system_boot_time(self): - stdout = b'' - stderr = b'' + stdout = u'' + stderr = u'' command_result = self._low_level_execute_command(self.DEFAULT_BOOT_TIME_COMMAND, sudoable=self.DEFAULT_SUDOABLE) # For single board computers, e.g., Raspberry Pi, that lack a real time clock and are using fake-hwclock