Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

update search path for 'ssh.exe' #743

Merged
merged 1 commit into from Jan 29, 2016
Merged

Conversation

sallyom
Copy link
Contributor

@sallyom sallyom commented Jan 21, 2016

bz 1294401
bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1294401

'rhc ssh ' fails with Windows 10 Home Edition because rhc does
not recognize 'C:\Program Files\Git\usr\bin\ssh.exe' as a possible
location for 'ssh.exe'. Updated to add this path. Also, updated the
Git install site recommendation since the current site is obsolete.

@sallyom
Copy link
Contributor Author

sallyom commented Jan 21, 2016

@tiwillia

@tiwillia
Copy link
Member

This LGTM assuming it works on windows. In testing, lets use git from the link we recommend to ensure that things work with that new version of git-for-windows.

@sallyom sallyom force-pushed the bz1294401 branch 3 times, most recently from ed8e9fd to a03c5c8 Compare January 22, 2016 13:21
@sallyom
Copy link
Contributor Author

sallyom commented Jan 22, 2016

@tiwillia I have confirmed that this fix works in Windows.
Also adding this: https://github.com/sallyom/rhc/blob/bz1294401/lib/rhc/ssh_helpers.rb#L464 allows users to specify any location for "ssh.exe" as long as the location is added to their $PATH.

@tiwillia
Copy link
Member

@sallyom, this looks great. Adding each directory in $PATH to the list of paths to search was an excellent idea, I'm surprised that was not already implemented.

Lets [test] this before we merge.

@tiwillia
Copy link
Member

[merge] please!

@sallyom
Copy link
Contributor Author

sallyom commented Jan 22, 2016

@tiwillia it was a great idea ;) My awesome friend, @DirectXMan12 suggested it....he sits next to us.
thanks!

@@ -461,9 +461,11 @@ def discover_ssh_executable
# looks for ssh.exe from msysgit or plink.exe from PuTTY, either on path or specific locations
guessing_locations <<
discover_windows_executables do |base|
[
from_path = ENV['PATH'].split(File::PATH_SEPARATOR).map {|p| p + File::ALT_SEPARATOR + "ssh.exe" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to add ENV['PATH'].split(File::PATH_SEPARATOR) to base_files in discover_windows_executables?

@sallyom sallyom force-pushed the bz1294401 branch 3 times, most recently from dbd1eb7 to 684dd52 Compare January 29, 2016 13:58
@sallyom
Copy link
Contributor Author

sallyom commented Jan 29, 2016

@Miciah, woohoo, i confirmed this fix works in Windows!

@sallyom
Copy link
Contributor Author

sallyom commented Jan 29, 2016

@Miciah, per our conversation, without re-writing the whole discover_windows_executables I believe this is the best fix? It will do a few extra searches but won't impact any other part of the code.
What do you think?

guessing_locations <<
discover_windows_executables do |base|
[
from_files = ENV['PATH'].split(File::PATH_SEPARATOR).map {|p| p + File::ALT_SEPARATOR + 'ssh.exe'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We lost the indentation here.

@Miciah
Copy link
Contributor

Miciah commented Jan 29, 2016

Yeah, I'm micro-irked by the extra searches this will incur, but it probably ultimately is the simplest way to fix the problem. Sorry for all the extra effort it took to come to that conclusion.

bz 1294401
bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1294401

'rhc ssh <app>' fails with Windows 10 Home Edition because rhc does
not recognize 'C:\Program Files\Git\usr\bin\ssh.exe' as a possible
location for 'ssh.exe'.  Updated to add this path.  Also, updated the
Git install site recommendation since the current site is obsolete.
@Miciah
Copy link
Contributor

Miciah commented Jan 29, 2016

Please [merge]!

@openshift-bot
Copy link

Evaluated for online test up to 390a0af

@openshift-bot
Copy link

Online Merge Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/merge_pull_requests/6698/) (Image: devenv_5760)

@openshift-bot
Copy link

Evaluated for online merge up to 390a0af

@openshift-bot
Copy link

openshift-bot pushed a commit that referenced this pull request Jan 29, 2016
@openshift-bot openshift-bot merged commit b82498a into openshift:master Jan 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants