Skip to content

Commit

Permalink
Merge pull request #3195 from TNP-Ltd/aruba-cx-whitespace-fix
Browse files Browse the repository at this point in the history
aoscx.rb: improve regex replacement to avoid whitespace commits
  • Loading branch information
robertcheramy authored Jun 19, 2024
2 parents 6b81dc6 + fcd890d commit ab63def
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/oxidized/model/aoscx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ class Aoscx < Oxidized::Model
cmd 'show environment' do |cfg|
cfg.gsub! /^(LC.*\s+)\d+\s+$/, '\\1<hidden>'
cfg.gsub! /^(\d\/\d\/\d.*\s+)\d+\s+$/, '\\1<hidden>'
cfg.gsub! /^(\d+\/\S+\s+\S+\s+)\d+\.\d+\s+C(.*)/, '\\1<hidden>\\2'
cfg.gsub! /^(\d+\/\S+\s+\S+\s+)\d+\.\d+\s+C\s+(.*)/, '\\1<hidden> \\2'
cfg.gsub! /^(LC.*\s+)\d+\.\d+\s+(C.*)$/, '\\1 <hidden> \\2'
cfg.gsub! /^(\S+\s+\S+\s+\s+\S+\s+)(slow|normal|medium|fast|max)(\s+\S+\s+\S+\s+)\d+/, '\\1<speed>\\3<rpm>'
cfg.gsub! /^(\S+\s+\S+\s+\s+\S+\s+)(slow|normal|medium|fast|max)\s+(\S+\s+\S+\s+)\d+\h+/, '\\1<speed> \\3<rpm>'
# match show environment power-consumption on VSF or standadlone, non-chassis and non-6400 switch, e.g. "2 6300M 48G 4SFP56 Swch 156.00 155.94"
cfg.gsub! /^(\d+\s+.+\s+)(\s{2}\d{2}\.\d{2}|\s{1}\d{3}\.\d{2}|\d{4}\.\d{2})(\s+)(\s{2}\d{2}\.\d{2}|\s{1}\d{3}\.\d{2}|\d{4}\.\d{2})$/, '\\1<power>\\3<power>'
# match show environment power-consumption on 6400 or chassis switches, e.g. "1/4 line-card-module R0X39A 6400 48p 1GbE CL4 PoE 4SFP56 Mod 54 W"
Expand Down

0 comments on commit ab63def

Please sign in to comment.