summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/procurve.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model/procurve.rb')
-rw-r--r--lib/oxidized/model/procurve.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/oxidized/model/procurve.rb b/lib/oxidized/model/procurve.rb
index c117df3..7dcf1fd 100644
--- a/lib/oxidized/model/procurve.rb
+++ b/lib/oxidized/model/procurve.rb
@@ -1,11 +1,16 @@
class Procurve < Oxidized::Model
- # some models start lines with \r
+ # some models start lines with \r
# previous command is repeated followed by "\eE", which sometimes ends up on last line
- prompt /^\r?([\w -]+\eE)?([\w.-]+# )$/
+ prompt /^\r?([\w.-]+# )$/
comment '! '
+ # replace next line control sequence with a new line
+ expect /(\e\[1M\e\[\??\d+(;\d+)*[A-Za-z]\e\[1L)|(\eE)/ do |data, re|
+ data.gsub re, "\n"
+ end
+
# replace all used vt100 control sequences
expect /\e\[\??\d+(;\d+)*[A-Za-z]/ do |data, re|
data.gsub re, ''
@@ -17,7 +22,7 @@ class Procurve < Oxidized::Model
end
cmd :all do |cfg|
- cfg = cfg.each_line.to_a[1..-3].join
+ cfg = cfg.each_line.to_a[1..-2].join
cfg = cfg.gsub /^\r/, ''
end