ambethia-backup 0.0.11 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/backup/ssh_helpers.rb +12 -16
- data/tests/actor_test.rb +0 -1
- data/tests/rotation_test.rb +0 -1
- metadata +2 -2
data/lib/backup/ssh_helpers.rb
CHANGED
@@ -25,7 +25,7 @@ module Backup
|
|
25
25
|
@channels.each do |ch|
|
26
26
|
next if ch[:closed]
|
27
27
|
active += 1
|
28
|
-
ch.connection.process(
|
28
|
+
ch.connection.process(0)
|
29
29
|
end
|
30
30
|
|
31
31
|
break if active == 0
|
@@ -47,28 +47,24 @@ module Backup
|
|
47
47
|
|
48
48
|
def open_channels
|
49
49
|
channel = actor.session.open_channel do |channel|
|
50
|
-
channel.request_pty
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
channel.request_pty do |ch, success|
|
51
|
+
if success
|
52
|
+
ch.exec command
|
53
|
+
ch.send_data options[:data] if options[:data]
|
54
|
+
else
|
55
|
+
ch.close
|
56
|
+
end
|
57
57
|
end
|
58
58
|
|
59
|
+
channel[:actor] = @actor
|
60
|
+
|
59
61
|
channel.on_data do |ch, data|
|
60
62
|
puts data
|
61
63
|
@callback[ch, :out, data] if @callback
|
62
64
|
end
|
63
65
|
|
64
|
-
channel.
|
65
|
-
|
66
|
-
# puts "we got a faulure"
|
67
|
-
ch.close
|
68
|
-
end
|
69
|
-
|
70
|
-
channel.on_request do |ch, request, reply, data|
|
71
|
-
ch[:status] = data.read_long if request == "exit-status"
|
66
|
+
channel.on_request "exit-status" do |ch, data|
|
67
|
+
ch[:status] = data.read_long
|
72
68
|
end
|
73
69
|
|
74
70
|
channel.on_close do |ch|
|
data/tests/actor_test.rb
CHANGED
data/tests/rotation_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ambethia-backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Murray
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-29 00:00:00 -07:00
|
13
13
|
default_executable: backup
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|