diff options
author | ytti <saku@ytti.fi> | 2016-04-08 13:59:08 +0300 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2016-04-08 13:59:08 +0300 |
commit | 525b1fe5f56b91082172cbbcaba90290118e5590 (patch) | |
tree | ecaa4c02f8be285f7f96a443447dd557d42d3365 | |
parent | b4477cb07c5b90a734f87a0bdb279bbb14967104 (diff) | |
parent | 5bce86bfe86e4b22740f92568312498fde9104b3 (diff) |
Merge pull request #385 from orealez/master
Fix for issue 359
-rw-r--r-- | lib/oxidized/model/tmos.rb | 16 |
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 |