mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-06 00:14:02 -07:00
win_reboot: fix minor issues with the latest refactor (#44740)
* win_reboot: fix minor issues with the latest refactor * Always return elapsed with win_reboot
This commit is contained in:
parent
7d51b2a6d2
commit
0c3216c565
3 changed files with 21 additions and 11 deletions
|
@ -134,7 +134,16 @@ class ActionModule(ActionBase):
|
|||
def run_test_command(self, **kwargs):
|
||||
test_command = self._task.args.get('test_command', self.DEFAULT_TEST_COMMAND)
|
||||
display.vvv("%s: attempting post-reboot test command '%s'" % (self._task.action, test_command))
|
||||
command_result = self._low_level_execute_command(test_command, sudoable=self.DEFAULT_SUDOABLE)
|
||||
try:
|
||||
command_result = self._low_level_execute_command(test_command, sudoable=self.DEFAULT_SUDOABLE)
|
||||
except Exception:
|
||||
# may need to reset the connection in case another reboot occurred
|
||||
# which has invalidated our connection
|
||||
try:
|
||||
self._connection.reset()
|
||||
except AttributeError:
|
||||
pass
|
||||
raise
|
||||
|
||||
result = {}
|
||||
if command_result['rc'] != 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue