summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized')
-rw-r--r--lib/oxidized/config.rb25
-rw-r--r--lib/oxidized/model/model.rb5
2 files changed, 18 insertions, 12 deletions
diff --git a/lib/oxidized/config.rb b/lib/oxidized/config.rb
index cb5f81d..9e5ec60 100644
--- a/lib/oxidized/config.rb
+++ b/lib/oxidized/config.rb
@@ -14,20 +14,21 @@ module Oxidized
attr_accessor :mgr
end
CFGS = Asetus.new :name=>'oxidized', :load=>false, :key_to_s=>true
- CFGS.default.username = 'username'
- CFGS.default.password = 'password'
- CFGS.default.model = 'junos'
- CFGS.default.interval = 3600
- CFGS.default.log = File.join Config::Root, 'log'
- CFGS.default.debug = false
- CFGS.default.threads = 30
- CFGS.default.timeout = 30
- CFGS.default.prompt = /^([\w.@-]+[#>]\s?)$/
- CFGS.default.rest = '0.0.0.0:8888' # or false to disable
- CFGS.default.vars = {} # could be 'enable'=>'enablePW'
+ CFGS.default.username = 'username'
+ CFGS.default.password = 'password'
+ CFGS.default.model = 'junos'
+ CFGS.default.interval = 3600
+ CFGS.default.log = File.join Config::Root, 'log'
+ CFGS.default.debug = false
+ CFGS.default.threads = 30
+ CFGS.default.timeout = 30
+ CFGS.default.prompt = /^([\w.@-]+[#>]\s?)$/
+ CFGS.default.rest = '0.0.0.0:8888' # or false to disable
+ CFGS.default.vars = {} # could be 'enable'=>'enablePW'
+ CFGS.default.remove_secret = false # runs cmd(:secret) blocks if true
CFGS.default.input.default = 'ssh, telnet'
- CFGS.default.input.ssh.secure = false # complain about changed certs
+ CFGS.default.input.ssh.secure = false # complain about changed certs
CFGS.default.output.default = 'file' # file, git
CFGS.default.source.default = 'csv' # csv, sql
diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb
index d8f5fe2..6e44039 100644
--- a/lib/oxidized/model/model.rb
+++ b/lib/oxidized/model/model.rb
@@ -80,6 +80,11 @@ module Oxidized
self.class.cmds[:all].each do |all_block|
out = instance_exec out, string, &all_block
end
+ if CFG.remove_secret?
+ self.class.cmds[:secret].each do |all_block|
+ out = instance_exec out, string, &all_block
+ end
+ end
out = instance_exec out, &block if block
out
end