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(
|
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
|
-
|
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)
|