oxidized-ssh 0.1.2.5 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oxidized/ssh.rb +11 -11
- data/lib/oxidized/ssh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb9c05418ae189e693908346e09d671734bedfdc
|
4
|
+
data.tar.gz: ba86e2d4552c041a1bc303428ff8e48ca74a74e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74f01e3bf948213dd0d672c643c2372fac701d14cf1ceec805390a50cf1419234b3da8103582246fbe0d6b7ba48cb56c0b5c8f5d622898065be5e5eb2de6873c
|
7
|
+
data.tar.gz: ea59dbda3fee12fcda1f1b74985cf47ecffe7fb7a57c597ae984da03a6ed52d10e74978a08523eccbfa5a2533bb31d767e57b302141fea0a233182da11fc0e53
|
data/lib/oxidized/ssh.rb
CHANGED
@@ -32,9 +32,9 @@ module Oxidized
|
|
32
32
|
return (@connection and not @connection.closed?)
|
33
33
|
end
|
34
34
|
|
35
|
-
def exec!(params)
|
35
|
+
def exec!(params, expect = @prompt)
|
36
36
|
check_for_connection
|
37
|
-
exec(params)
|
37
|
+
exec(params, expect)
|
38
38
|
sanitize_output_buffer("\n", /\r\n/)
|
39
39
|
sanitize_output_buffer('', params)
|
40
40
|
@output
|
@@ -44,27 +44,27 @@ module Oxidized
|
|
44
44
|
prep_connection unless @session
|
45
45
|
end
|
46
46
|
|
47
|
-
def exec(params)
|
47
|
+
def exec(params, expectation)
|
48
48
|
if @exec
|
49
|
-
@logger.debug "sending exec command #{params}"
|
49
|
+
@logger.debug "sending exec command #{params}" if @debug
|
50
50
|
@output = @connection.exec!(params)
|
51
51
|
else
|
52
|
-
@logger.debug "sending command #{params} with expectation of #{
|
53
|
-
collect_output(params)
|
52
|
+
@logger.debug "sending command #{params} with expectation of #{expectation}" if @debug
|
53
|
+
collect_output(params, expectation)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
def collect_output(params)
|
58
|
-
send_data((params + "\n"))
|
57
|
+
def collect_output(params, expectation)
|
58
|
+
send_data((params + "\n"), expectation)
|
59
59
|
return @output
|
60
60
|
end
|
61
61
|
|
62
|
-
def send_data(params)
|
63
|
-
expect
|
62
|
+
def send_data(params, expectation)
|
63
|
+
expect expectation
|
64
64
|
reset_output_buffer
|
65
65
|
send(params)
|
66
66
|
@session.process
|
67
|
-
expect
|
67
|
+
expect expectation
|
68
68
|
@output
|
69
69
|
end
|
70
70
|
|
data/lib/oxidized/ssh/version.rb
CHANGED