-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
win_reboot: fix minor issues with the latest refactor #44740
Conversation
lib/ansible/plugins/action/reboot.py
Outdated
@@ -274,8 +283,9 @@ def run(self, tmp=None, task_vars=None): | |||
|
|||
if reboot_result['failed']: | |||
result = reboot_result | |||
elapsed = datetime.utcnow() - reboot_result['start'] | |||
result['elapsed'] = elapsed.seconds | |||
if 'start' in reboot_result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to always return elapsed
, which means always returning result['start']
. This is done here in reboot.py
. That change didn't make it to win_reboot.py
. Sorry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries will add that in now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I prefer having elapsed returned always, we do that for other modules too.
#37969
(feel free to approve my work there ;-))
SUMMARY
Fixes a few issues with the recent reboot refactoring and the win_reboot tests;
run_test_command
on a failure, this solves the issue where the host si rebooting multiple times and winrm needs to reset the shell id so it starts working againperform_reboot()
didn't succeedISSUE TYPE
COMPONENT NAME
win_reboot
ANSIBLE VERSION