Skip to content

Commit

Permalink
Merge pull request #146 from Ferada/allow-shell-paths
Browse files Browse the repository at this point in the history
Resolve the SSH key path later.
  • Loading branch information
petems committed Jan 31, 2015
2 parents 7f25f55 + 3b50e47 commit 8f8543a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/tugboat/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def reload!
def create_config_file(client, api, ssh_key_path, ssh_user, ssh_port, region, image, size, ssh_key, private_networking, backups_enabled)
# Default SSH Key path
if ssh_key_path.empty?
ssh_key_path = File.join(File.expand_path("~"), DEFAULT_SSH_KEY_PATH)
ssh_key_path = File.join("~", DEFAULT_SSH_KEY_PATH)
end

if ssh_user.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/tugboat/middleware/ssh_droplet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def call(env)
"-o", "LogLevel=ERROR",
"-o", "StrictHostKeyChecking=no",
"-o", "UserKnownHostsFile=/dev/null",
"-i", env["config"].ssh_key_path.to_s]
"-i", File.expand_path(env["config"].ssh_key_path.to_s)]

if env["user_droplet_ssh_port"]
options.push("-p", env["user_droplet_ssh_port"].to_s)
Expand Down
4 changes: 2 additions & 2 deletions spec/middleware/ssh_droplet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"-o", "LogLevel=ERROR",
"-o", "StrictHostKeyChecking=no",
"-o", "UserKnownHostsFile=/dev/null",
"-i", ssh_key_path,
"-i", File.expand_path(ssh_key_path),
"-p", ssh_port,
"#{ssh_user}@#{droplet_ip_private}")

Expand All @@ -32,7 +32,7 @@
"-o", "LogLevel=ERROR",
"-o", "StrictHostKeyChecking=no",
"-o", "UserKnownHostsFile=/dev/null",
"-i", ssh_key_path,
"-i", File.expand_path(ssh_key_path),
"-p", ssh_port,
"-e",
"-q",
Expand Down

0 comments on commit 8f8543a

Please sign in to comment.