summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-04-08 13:59:08 +0300
committerytti <saku@ytti.fi>2016-04-08 13:59:08 +0300
commit525b1fe5f56b91082172cbbcaba90290118e5590 (patch)
treeecaa4c02f8be285f7f96a443447dd557d42d3365 /lib/oxidized
parentb4477cb07c5b90a734f87a0bdb279bbb14967104 (diff)
parent5bce86bfe86e4b22740f92568312498fde9104b3 (diff)
Merge pull request #385 from orealez/master
Fix for issue 359
Diffstat (limited to 'lib/oxidized')
-rw-r--r--lib/oxidized/model/tmos.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/oxidized/model/tmos.rb b/lib/oxidized/model/tmos.rb
index abaec9f..390046d 100644
--- a/lib/oxidized/model/tmos.rb
+++ b/lib/oxidized/model/tmos.rb
@@ -3,18 +3,20 @@ class TMOS < Oxidized::Model
comment '# '
cmd :secret do |cfg|
- cfg.gsub!(/password (\S+)/, 'password <secret removed>')
- cfg.gsub!(/passphrase (\S+)/, 'passphrase <secret removed>')
- cfg.gsub!(/community (\S+)/, 'community <secret removed>')
- cfg.gsub!(/community-name (\S+)/, 'community-name <secret removed>')
+ cfg.gsub!(/^([\s\t]*)secret \S+/, '\1secret <secret removed>')
+ cfg.gsub!(/^([\s\t]*\S*)password \S+/, '\1password <secret removed>')
+ cfg.gsub!(/^([\s\t]*\S*)passphrase \S+/, '\1passphrase <secret removed>')
+ cfg.gsub!(/community \S+/, 'community <secret removed>')
+ cfg.gsub!(/community-name \S+/, 'community-name <secret removed>')
+ cfg.gsub!(/^([\s\t]*\S*)encrypted \S+$/, '\1encrypted <secret removed>')
cfg
end
- cmd('tmsh show sys version') { |cfg| comment cfg }
+ cmd('tmsh -q show sys version') { |cfg| comment cfg }
- cmd('tmsh show sys software') { |cfg| comment cfg }
+ cmd('tmsh -q show sys software') { |cfg| comment cfg }
- cmd 'tmsh show sys hardware field-fmt' do |cfg|
+ cmd 'tmsh -q show sys hardware field-fmt' do |cfg|
cfg.gsub!(/fan-speed (\S+)/, '')
cfg.gsub!(/temperature (\S+)/, '')
comment cfg