From 81ad5c8bdb6519f7c1434bb3cd21fde791259a86 Mon Sep 17 00:00:00 2001
From: Ultra2D <Ultra2D@users.noreply.github.com>
Date: Fri, 10 Feb 2017 10:02:32 +0100
Subject: Remove (some) secrets from Comware config

---
 lib/oxidized/model/comware.rb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/oxidized/model/comware.rb b/lib/oxidized/model/comware.rb
index 27b70ae..d926854 100644
--- a/lib/oxidized/model/comware.rb
+++ b/lib/oxidized/model/comware.rb
@@ -18,6 +18,12 @@ class Comware < Oxidized::Model
     cfg.each_line.to_a[1..-2].join
   end
  
+  cmd :secret do |cfg|
+    cfg.gsub! /^( snmp-agent community).*/, '\\1 <configuration removed>'
+    cfg.gsub! /^( password hash).*/, '\\1 <configuration removed>'
+    cfg
+  end
+
   cfg :telnet do
     username /^Username:$/
     password /^Password:$/
-- 
cgit v1.2.3