symphony-ssh 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/symphony/tasks/ssh.rb +11 -4
- data/lib/symphony/tasks/sshscript.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c93e395b96d34101bb5c100733522814ae85ade
|
4
|
+
data.tar.gz: f1c0f325add294be5bfce9eb02144d9cf424946d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a97df10467dff6f1d03b8266c63171f48880d1a1be9647eb537c6e9f640251024a4cc0650b86af6de2f13cc89b977b988ddfc7f0e4adf0f26e54207eddef7a2
|
7
|
+
data.tar.gz: 19f949f31461e467d6020b349783dd7d06c5ce1085b5f503e1b34fd6f0ac9a1346ec22e2078561432661a42b9b9b026b938ae6e1dc73d45c964a6f9b0d9616f1
|
data/lib/symphony/tasks/ssh.rb
CHANGED
@@ -88,7 +88,7 @@ class Symphony::Task::SSH < Symphony::Task
|
|
88
88
|
### Configurability API.
|
89
89
|
###
|
90
90
|
def self::configure( config=nil )
|
91
|
-
config =
|
91
|
+
config = Symphony::Task::SSH.defaults.merge( config || {} )
|
92
92
|
@path = config.delete( :path )
|
93
93
|
@opts = config.delete( :opts )
|
94
94
|
@user = config.delete( :user )
|
@@ -137,7 +137,7 @@ class Symphony::Task::SSH < Symphony::Task
|
|
137
137
|
|
138
138
|
cmd = []
|
139
139
|
cmd << Symphony::Task::SSH.path
|
140
|
-
cmd +=
|
140
|
+
cmd += opts
|
141
141
|
|
142
142
|
cmd << '-p' << port.to_s
|
143
143
|
cmd << '-i' << key if key
|
@@ -149,7 +149,7 @@ class Symphony::Task::SSH < Symphony::Task
|
|
149
149
|
parent_reader, child_writer = IO.pipe
|
150
150
|
child_reader, parent_writer = IO.pipe
|
151
151
|
|
152
|
-
pid = spawn( *cmd, :out => child_writer, :in => child_reader, :close_others => true )
|
152
|
+
pid = Process.spawn( *cmd, :out => child_writer, :in => child_reader, :close_others => true )
|
153
153
|
child_writer.close
|
154
154
|
child_reader.close
|
155
155
|
|
@@ -158,7 +158,14 @@ class Symphony::Task::SSH < Symphony::Task
|
|
158
158
|
@output = @output.split("\n").reject{|l| l =~ SSH_CLEANUP }.join
|
159
159
|
self.log.debug " run block done."
|
160
160
|
|
161
|
-
|
161
|
+
status = nil
|
162
|
+
|
163
|
+
ensure
|
164
|
+
if pid
|
165
|
+
active = Process.kill( 0, pid ) rescue false
|
166
|
+
Process.kill( :TERM, pid ) if active
|
167
|
+
pid, status = Process.waitpid2( pid )
|
168
|
+
end
|
162
169
|
return status
|
163
170
|
end
|
164
171
|
|
@@ -90,7 +90,7 @@ class Symphony::Task::SSHScript < Symphony::Task
|
|
90
90
|
### Configurability API.
|
91
91
|
###
|
92
92
|
def self::configure( config=nil )
|
93
|
-
config =
|
93
|
+
config = Symphony::Task::SSHScript.defaults.merge( config || {} )
|
94
94
|
@user = config.delete( :user )
|
95
95
|
@key = config.delete( :key )
|
96
96
|
super
|
@@ -108,7 +108,7 @@ class Symphony::Task::SSHScript < Symphony::Task
|
|
108
108
|
key = payload[ 'key' ] || Symphony::Task::SSHScript.key
|
109
109
|
nocleanup = payload[ 'nocleanup' ]
|
110
110
|
|
111
|
-
raise ArgumentError, "Missing required option '
|
111
|
+
raise ArgumentError, "Missing required option 'template'" unless template
|
112
112
|
raise ArgumentError, "Missing required option 'host'" unless payload[ 'host' ]
|
113
113
|
|
114
114
|
remote_filename = self.make_remote_filename( template )
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: symphony-ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mahlon E. Smith <mahlon@martini.nu>
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: symphony
|