summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/aosw.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model/aosw.rb')
-rw-r--r--lib/oxidized/model/aosw.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb
index d533727..11d8442 100644
--- a/lib/oxidized/model/aosw.rb
+++ b/lib/oxidized/model/aosw.rb
@@ -28,19 +28,21 @@ class AOSW < Oxidized::Model
cmd 'show version' do |cfg|
cfg = cfg.each_line.select { |line| not line.match /Switch uptime/i }
- comment cfg.join
+ rstrip_cfg comment cfg.join
end
cmd 'show inventory' do |cfg|
- clean cfg
+ rstrip_cfg clean cfg
end
cmd 'show slots' do |cfg|
- comment cfg
+ rstrip_cfg comment cfg
end
+
cmd 'show license' do |cfg|
- comment cfg
+ rstrip_cfg comment cfg
end
+
cmd 'show running-config' do |cfg|
out = []
cfg.each_line do |line|
@@ -61,7 +63,7 @@ class AOSW < Oxidized::Model
if vars :enable
post_login do
send "enable\n"
- send vars(:enable) + "\n"
+ cmd vars(:enable)
end
end
post_login 'no paging'
@@ -72,6 +74,15 @@ class AOSW < Oxidized::Model
pre_logout 'exit'
end
+ def rstrip_cfg cfg
+ out = []
+ cfg.each_line do |line|
+ out << line.rstrip
+ end
+ out = out.join "\n"
+ out << "\n"
+ end
+
def clean cfg
out = []
cfg.each_line do |line|