Fixes #13491 - handle ssh disconnection#20
Conversation
For example, when rebooting as part for the script.
|
I've added a simple detection of expected disconnections based on stdout. The plan is to seed |
specific messages (such as 'restart host' on stdout) as last output of a command cause the disconnect issue to not cause the task to fail, as it's expected in that case.
54e2876 to
43f2503
Compare
Would it be possible to integrate into Foreman's power controls somehow? Not so familiar with this part but there is some BMC integration, and maybe there could be an alternative REX/SSH provider using the developer API. |
|
For now, I've added a job template for the power management control: iNecas/foreman_remote_execution@9ec393c. Yes, the developer API could be used to intergrate it into the BMC, but I would prefer having a seperate issue opened for this. |
| def refresh_command_buffer | ||
| @logger.debug("command #{@command} got new output: #{@command_buffer.inspect}") | ||
| command_update = CommandUpdate.new(@command_buffer) | ||
| check_expecting_disconnect |
There was a problem hiding this comment.
What's the point of check_expecting_disconnect here?
There was a problem hiding this comment.
We need to determine, if the disconnection was expected (such as when calling reboot) or it was an error. We need to do it on two places, because the @command_buffer could be filled in this, or previous iteration.
There was a problem hiding this comment.
Oh, I see, thanks for the explanation
|
Works as expected, ACK |
|
Issue for the BMC provider filled here http://projects.theforeman.org/issues/13688 |
Fixes #13491 - handle ssh disconnection
For example, when rebooting as part for the script.