summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/model/opengear.rb2
-rw-r--r--lib/oxidized/model/timos.rb16
-rw-r--r--lib/oxidized/source/http.rb2
3 files changed, 19 insertions, 1 deletions
diff --git a/lib/oxidized/model/opengear.rb b/lib/oxidized/model/opengear.rb
index 7f801f8..b7c697f 100644
--- a/lib/oxidized/model/opengear.rb
+++ b/lib/oxidized/model/opengear.rb
@@ -1,6 +1,8 @@
class OpenGear < Oxidized::Model
comment '# '
+
+ prompt /^(\$\s)?$/
cmd :secret do |cfg|
cfg.gsub!(/password (\S+)/, 'password <secret removed>')
diff --git a/lib/oxidized/model/timos.rb b/lib/oxidized/model/timos.rb
index d40e845..c230a8f 100644
--- a/lib/oxidized/model/timos.rb
+++ b/lib/oxidized/model/timos.rb
@@ -18,6 +18,8 @@ class TiMOS < Oxidized::Model
# Show the boot options file.
#
cmd 'show bof' do |cfg|
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
comment cfg
end
@@ -29,6 +31,8 @@ class TiMOS < Oxidized::Model
# Strip uptime.
#
cfg.sub! /^System Up Time.*\n/, ''
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
comment cfg
end
@@ -36,6 +40,8 @@ class TiMOS < Oxidized::Model
# Show the card state.
#
cmd 'show card state' do |cfg|
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
comment cfg
end
@@ -48,6 +54,8 @@ class TiMOS < Oxidized::Model
#
cfg.gsub! /\r/, ''
cfg.gsub! /[\b][\b][\b]/, "\n"
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
comment cfg
end
@@ -55,6 +63,8 @@ class TiMOS < Oxidized::Model
# Show the running debug configuration.
#
cmd 'show debug' do |cfg|
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
comment cfg
end
@@ -66,6 +76,8 @@ class TiMOS < Oxidized::Model
# Strip carriage returns.
#
cfg.gsub! /\r/, ''
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
comment cfg
end
@@ -77,6 +89,8 @@ class TiMOS < Oxidized::Model
# Strip carriage returns.
#
cfg.gsub! /\r/, ''
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
comment cfg
end
@@ -88,6 +102,8 @@ class TiMOS < Oxidized::Model
# Strip carriage returns.
#
cfg.gsub! /\r/, ''
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
end
cfg :telnet do
diff --git a/lib/oxidized/source/http.rb b/lib/oxidized/source/http.rb
index 7186f98..6c12f29 100644
--- a/lib/oxidized/source/http.rb
+++ b/lib/oxidized/source/http.rb
@@ -29,7 +29,7 @@ class HTTP < Source
end
request = Net::HTTP::Get.new(uri.request_uri, headers)
- if (@cfg.user && @cfg.pass)
+ if (@cfg.user? && @cfg.pass?)
request.basic_auth(@cfg.user,@cfg.pass)
end