blower 4.0 → 4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blower/host.rb +19 -3
- data/lib/blower/version.rb +1 -1
- 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: 695f6fc9dc74d93169915948b0223367c3527bca
|
4
|
+
data.tar.gz: 900f31427700bc6879c8fbd2295aeb6647802c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef2781ac7652126053e28006165de815451a7fc17d33243a8055c878c8f15663829424f9b106ec85daf37468dfcc68893bed7d4cfb87931d8a166c6d3832a0b5
|
7
|
+
data.tar.gz: c8fb921ceecac7cef82aa00f9ce377dbd6b45d0ad59a975862e247c77065f33996daf4813b9dda2e2b93b99b93cd8ae16a8347859a29ddccf9bf2f95534189cc
|
data/lib/blower/host.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/ssh'
|
2
|
+
require 'net/ssh/gateway'
|
2
3
|
require 'net/scp'
|
3
4
|
require 'monitor'
|
4
5
|
require 'colorize'
|
@@ -16,12 +17,16 @@ module Blower
|
|
16
17
|
# The host adress.
|
17
18
|
attr_accessor :address
|
18
19
|
|
20
|
+
# The gateway host
|
21
|
+
attr_accessor :via
|
22
|
+
|
19
23
|
def_delegators :data, :[], :[]=
|
20
24
|
|
21
|
-
def initialize (address, data: {}, user: "root")
|
25
|
+
def initialize (address, data: {}, user: "root", via: nil)
|
22
26
|
@address = address
|
23
27
|
@user = user
|
24
28
|
@data = data
|
29
|
+
@via = via
|
25
30
|
super()
|
26
31
|
end
|
27
32
|
|
@@ -139,6 +144,12 @@ module Blower
|
|
139
144
|
@log ||= Logger.instance.with_prefix("on #{self}: ")
|
140
145
|
end
|
141
146
|
|
147
|
+
# Connect to the host as a Gateway
|
148
|
+
# @api private
|
149
|
+
def gateway ()
|
150
|
+
Net::SSH::Gateway(address, user)
|
151
|
+
end
|
152
|
+
|
142
153
|
private
|
143
154
|
|
144
155
|
attr_accessor :data
|
@@ -150,8 +161,13 @@ module Blower
|
|
150
161
|
@sessions[user] = nil
|
151
162
|
end
|
152
163
|
@sessions[user] ||= begin
|
153
|
-
|
154
|
-
|
164
|
+
if @via
|
165
|
+
log.debug "Connecting to ssh:#{self} via ssh:#{via}"
|
166
|
+
via.gateway.ssh(address, user)
|
167
|
+
else
|
168
|
+
log.debug "Connecting to ssh:#{self}"
|
169
|
+
Net::SSH.start(address, user)
|
170
|
+
end
|
155
171
|
end
|
156
172
|
end
|
157
173
|
|
data/lib/blower/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blower
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '4.
|
4
|
+
version: '4.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Baum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|