Skip to content
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

Merged
merged 2 commits into from
Aug 28, 2018

Conversation

jborean93
Copy link
Contributor

SUMMARY

Fixes a few issues with the recent reboot refactoring and the win_reboot tests;

  • resets the connection on 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 again
  • only add the elapsed return value if the start key exists (it may not if perform_reboot() didn't succeed
  • fix the Windows shutdown abort code path now it is using low_level_execute_command
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

win_reboot

ANSIBLE VERSION
devel

@samdoran samdoran self-assigned this Aug 27, 2018
@ansibot
Copy link
Contributor

ansibot commented Aug 27, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. windows Windows community needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Aug 27, 2018
@@ -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:
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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 ;-))

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Aug 28, 2018
@samdoran samdoran merged commit 0c3216c into ansible:devel Aug 28, 2018
@jborean93 jborean93 deleted the win_reboot-fix branch August 28, 2018 22:11
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. windows Windows community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants