Skip to content

Commit

Permalink
Handle escaping before executing a task on server
Browse files Browse the repository at this point in the history
[#99887000]
  • Loading branch information
sabcio committed Aug 31, 2015
1 parent 1991de5 commit 462d18a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## master

* [improvement] shelly rake accepts rake arguments and properly escapes whitespaces
* [bugfix] Display proper error for shelly files commands depending on resource

## 0.5.5 / 2015-03-16
Expand Down
2 changes: 1 addition & 1 deletion lib/shelly/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def delete_endpoint(uuid)
end

def rake(task, server = nil)
ssh(:command => "rake_runner \"#{task}\"", :server => server)
ssh(:command => "rake_runner '#{task.inspect}'", :server => server)
end

def dbconsole
Expand Down
2 changes: 1 addition & 1 deletion spec/shelly/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def config_response
it "should return result of rake task" do
@client.stub(:tunnel).and_return(
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
@app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com rake_runner \"test\"")
@app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com rake_runner '\"test\"'")
@app.rake("test")
end

Expand Down

0 comments on commit 462d18a

Please sign in to comment.