engineyard-serverside 1.6.4.pre5 → 1.6.4.pre6

Sign up to get free protection for your applications and to get access to all the features.
@@ -83,7 +83,7 @@ module EY
83
83
  if local?
84
84
  logged_system(command)
85
85
  else
86
- logged_system("#{ssh_command} #{Escape.shell_command ["#{user}@#{hostname}", Escape.shell_command(%w["sh -l -c"] + [command])]}")
86
+ logged_system(ssh_command + " " + Escape.shell_command(["#{user}@#{hostname}", command]))
87
87
  end
88
88
  end
89
89
 
@@ -45,18 +45,16 @@ module EY
45
45
  end
46
46
 
47
47
  def sudo(cmd, &blk)
48
- sudo_cmd = "sudo sh -c #{Escape.shell_command [cmd]}"
49
-
50
- run_on_roles(sudo_cmd, &blk)
48
+ run_on_roles(cmd, %w[sudo sh -l -c], &blk)
51
49
  end
52
50
 
53
51
  private
54
52
 
55
- def run_on_roles(cmd, &block)
53
+ def run_on_roles(cmd, wrapper=%w[sh -l -c], &block)
56
54
  servers = EY::Serverside::Server.from_roles(@roles)
57
55
  futures = EY::Serverside::Future.call(servers, block_given?) do |server, exec_block|
58
56
  to_run = exec_block ? block.call(server, cmd.dup) : cmd
59
- server.run(to_run)
57
+ server.run(Escape.shell_command(wrapper + [to_run]))
60
58
  end
61
59
 
62
60
  unless EY::Serverside::Future.success?(futures)
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Serverside
3
- VERSION = '1.6.4.pre5'
3
+ VERSION = '1.6.4.pre6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.4.pre5
4
+ version: 1.6.4.pre6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: