-
Notifications
You must be signed in to change notification settings - Fork 79
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
MiqSshUtil updates #437
MiqSshUtil updates #437
Conversation
Checked commit https://github.com/djberg96/manageiq-gems-pending/commit/c950fa8fede20a014dcc9b3bc885978adbdababd with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 lib/gems/pending/util/MiqSshUtil.rb
|
@roliveri How's it look? |
@miq-bot add_label bug, changelog/yes |
@miq-bot add_label hammer/yes |
@carbonin Alright, I've added some specs that should demonstrate that it behaves as expected. I didn't want to go down this road originally because I knew it would mean making a couple other refactorings. Namely, the |
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.
LGTM, but leaving the final merge to @carbonin
MiqSshUtil updates (cherry picked from commit 02c9fb6) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1726439
Hammer backport details:
|
This PR fixes a bug in the
MiqSshUtil#exec
method, and makes a few tweaks to the constructor and exec method in general.Fixes:
Error handling is currently semi-busted. The
on_extended_data
hook is missing a yield param. The net result is that there is never any data in the error output. In addition, thestatus
check could break since it defaults to nil, with the result that it will try to call.zero?
on a nil object, which will raise an exception. So, I changed the default from nil to 0.Updates:
use_agent
option. It still defaults to false for backwards compatibility.You can see these issues in practice with this simple script:
BEFORE:
RESULT:
<---- Blank! And not registered as an error!AFTER:
OOPS: MiqSshUtil::exec - Command 'bogus' failed: bash: bogus: command not found, status: 127
Partially addresses https://bugzilla.redhat.com/show_bug.cgi?id=1719689