Refactor input/ssh and input/scp into SSHBase#3721
Merged
robertcheramy merged 6 commits intomasterfrom Jan 13, 2026
Merged
Conversation
- Change RESCUE_FAIL format to {exception => level}
- Introduce inheritable .rescue_fail class method
- Simplify Node#run_input exception handling
- Prepare for shared SSHBase input class for ssh and scp
- Remove unused RESCUE_FAIL in ftp and telnet
- closes #3597 - move 'include CLI' to input.rb as all input classes need and include it ('get' is mandatory) - add net-tftp as an optional (development) dependency - scp get the same make_ssh_opts as ssh, which does more, but should also work for scp - implementing sftp should be a simple as the SCP class. - SSH#disconect may be refactored into SSHBase#disconect, as @ssh.close waits for the channels to close, so we might not need to call @ssh.loop to close the channels.
SSH#disconnect directly calls @ssh.close, as #close waits for the channels to be closed anyway. This should work the same way as calling @ssh.loop and @ssh.close after a timeout.
As SSH#disconnect now calls @ssh.close, we have to implement it in the SSH simulation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-Request Checklist
rubocop --auto-correct)rake test)Description
Closes #3597
Smaller Changes:
Note that implementing sftp [which is the protocol used in modern scp, the old scp protocol is deprecated] should be easy (roughly: duplicate scp.rb and rename scp to sftp) if someone has the need for it. I need to keep the old scp protocol because APC Network Management Cards (apc_aos.rb) works only with old scp.