riscos 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +3 -1
- data/lib/riscos.rb +16 -10
- metadata +2 -2
data/Changelog
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
2009-
|
1
|
+
2009-04-20 Making timeout available to initializer in setup of a new device.
|
2
|
+
|
3
|
+
2009-01-23 Initial release. Its working for me in lab and testing environment. I'm looking for feedback from other users.
|
data/lib/riscos.rb
CHANGED
@@ -11,11 +11,11 @@ module Cisco
|
|
11
11
|
@user = options[:user] || "nil"
|
12
12
|
@pw = options[:pw] || "nil" #login pass
|
13
13
|
@enpw = options[:enpw] || "nil" #enable pass
|
14
|
+
@timeout = options[:timeout] || 10
|
14
15
|
@r = "/dev/null" #reader socket
|
15
16
|
@w = "/dev/null" #writer socket
|
16
17
|
@p = nil #pid to kill later
|
17
18
|
@prompt = /\r\n\r.*[#>]\s?\z/n
|
18
|
-
@timeout = 10
|
19
19
|
@output = Array.new
|
20
20
|
@info = Array.new #store configuration info gleaned from config
|
21
21
|
@error = Array.new
|
@@ -200,7 +200,7 @@ module Cisco
|
|
200
200
|
end
|
201
201
|
end
|
202
202
|
|
203
|
-
def
|
203
|
+
def showowners
|
204
204
|
o = run("show run owner")
|
205
205
|
o = o.first.split("\r\r\r\n")
|
206
206
|
# we need to chomp the first and last lines
|
@@ -210,8 +210,11 @@ module Cisco
|
|
210
210
|
o[2..-1].each do |l|
|
211
211
|
next if l.empty?
|
212
212
|
l = l.split
|
213
|
-
line =
|
213
|
+
line = l
|
214
|
+
line = case l.first
|
215
|
+
|
214
216
|
when /^owner/
|
217
|
+
|
215
218
|
@ow=l.last
|
216
219
|
@owner[@ow]
|
217
220
|
when /content/
|
@@ -229,12 +232,13 @@ module Cisco
|
|
229
232
|
end
|
230
233
|
end
|
231
234
|
|
232
|
-
def
|
235
|
+
def showsslproxies
|
236
|
+
@details=[]
|
233
237
|
s= run("show run ssl-proxy-list")
|
234
238
|
s=s.first.split("\r\r\r\n")
|
235
239
|
s[3..-2].each do |l|
|
236
240
|
l=l.split
|
237
|
-
|
241
|
+
pp l
|
238
242
|
line = case l.first
|
239
243
|
when /ssl-proxy-list/
|
240
244
|
@proxy=l.last
|
@@ -242,12 +246,14 @@ module Cisco
|
|
242
246
|
when /^active/
|
243
247
|
@sslproxy[@proxy]["active"]=true
|
244
248
|
when /ssl-server/
|
245
|
-
@details
|
249
|
+
@details.push((l[2..-1].collect {|x| x + " " }).to_s)
|
246
250
|
@server=l[1]
|
247
|
-
|
251
|
+
next if l[2].nil?
|
252
|
+
|
253
|
+
@sslproxy[@proxy][@server][l[2]]=(l[3..-1].collect {|x| x + " " }).to_s #@details
|
248
254
|
when /.*?\\s.*?/
|
249
|
-
|
250
|
-
@details.push((l.last[2..-1].collect {|x| x + " " }).to_s)
|
255
|
+
|
256
|
+
@details.push((l.last[2..-1].collect {|x| x + " " }).to_s.chop)
|
251
257
|
# @details.delete("")
|
252
258
|
@sslproxy[@proxy][@server]=@details
|
253
259
|
|
@@ -264,4 +270,4 @@ module Cisco
|
|
264
270
|
|
265
271
|
end
|
266
272
|
|
267
|
-
end
|
273
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riscos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Voccio
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-20 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|