-
Notifications
You must be signed in to change notification settings - Fork 29
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
Added Functionality to support Non-Standard SSH Port in the Adapters. #797
Conversation
lib/ood_core/job/adapters/helper.rb
Outdated
@@ -26,7 +26,7 @@ def self.ssh_wrap(submit_host, cmd, cmd_args, strict_host_checking = true, env = | |||
return cmd, cmd_args if submit_host.to_s.empty? | |||
|
|||
check_host = strict_host_checking ? "yes" : "no" | |||
args = ['-o', 'BatchMode=yes', '-o', 'UserKnownHostsFile=/dev/null', '-o', "StrictHostKeyChecking=#{check_host}", "#{submit_host}"] | |||
args = ['-p', ENV["OOD_SSH_PORT"].nil? ? "22" : "#{ENV['OOD_SSH_PORT']}", '-o', 'BatchMode=yes', '-o', 'UserKnownHostsFile=/dev/null', '-o', "StrictHostKeyChecking=#{check_host}", "#{submit_host}"] |
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.
Can you put this logic in a helper function like this so other things can just refercen the fuction without the logic. (also be sure to cast to an integer)
def ssh_port
ENV["OOD_SSH_PORT"].nil? ? "22" : ENV['OOD_SSH_PORT'].to_i.to_s
end
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.
Can you put this logic in a helper function like this so other things can just refercen the fuction without the logic. (also be sure to cast to an integer)
def ssh_port ENV["OOD_SSH_PORT"].nil? ? "22" : ENV['OOD_SSH_PORT'].to_i.to_s end
The Helper is a good idea. Thanks!
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
Added Functionality to support Non-Standard SSH Port in the Adapters.
The environment variable for ssh port is: ENV['OOD_SSH_PORT']
┆Issue is synchronized with this Asana task by Unito