summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-04-14 17:24:19 +0300
committerSaku Ytti <saku@ytti.fi>2014-04-14 17:24:19 +0300
commitf75316a096449d8eec01d4fbed57016b4538e17f (patch)
treec29d4d84d59c3a12df53da215058570ed8b6309f
parent57a8f4bc04b4f87ad0d7028dcbf29b96d49eaffd (diff)
depend on Asetus
Change models to Asetus syntax
-rw-r--r--lib/oxidized/model/acos.rb4
-rw-r--r--lib/oxidized/model/ios.rb6
-rw-r--r--lib/oxidized/model/iosxr.rb4
-rw-r--r--oxidized.gemspec1
4 files changed, 8 insertions, 7 deletions
diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb
index 8ac9165..f06bc93 100644
--- a/lib/oxidized/model/acos.rb
+++ b/lib/oxidized/model/acos.rb
@@ -55,10 +55,10 @@ class ACOS < Oxidized::Model
cfg :telnet, :ssh do
# preferred way to handle additional passwords
- if CFG.vars[:enable] and CFG.vars[:enable] != ''
+ if CFG.vars.enable?
post_login do
send "enable\n"
- send CFG.vars[:enable] + "\n"
+ send CFG.vars.enable + "\n"
end
end
post_login 'terminal length 0'
diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb
index b9a9316..11e605a 100644
--- a/lib/oxidized/model/ios.rb
+++ b/lib/oxidized/model/ios.rb
@@ -12,7 +12,7 @@ class IOS < Oxidized::Model
# non-preferred way to handle additional PW prompt
#expect /^[\w.]+>$/ do |data|
# send "enable\n"
- # send CFG.vars[:enable] + "\n"
+ # send CFG.vars.enable + "\n"
# data
#end
@@ -45,10 +45,10 @@ class IOS < Oxidized::Model
post_login 'terminal length 0'
post_login 'terminal width 0'
# preferred way to handle additional passwords
- if CFG.vars[:enable] and CFG.vars[:enable] != ''
+ if CFG.vars.enable?
post_login do
send "enable\n"
- send CFG.vars[:enable] + "\n"
+ send CFG.vars.enable + "\n"
end
end
pre_logout 'exit'
diff --git a/lib/oxidized/model/iosxr.rb b/lib/oxidized/model/iosxr.rb
index 6bad8cd..023dcca 100644
--- a/lib/oxidized/model/iosxr.rb
+++ b/lib/oxidized/model/iosxr.rb
@@ -29,10 +29,10 @@ class IOSXR < Oxidized::Model
cfg :telnet, :ssh do
post_login 'terminal length 0'
post_login 'terminal width 0'
- if CFG.vars[:enable] and CFG.vars[:enable] != ''
+ if CFG.vars.enable?
post_login do
send "enable\n"
- send CFG.vars[:enable] + "\n"
+ send CFG.vars.enable + "\n"
end
end
pre_logout 'exit'
diff --git a/oxidized.gemspec b/oxidized.gemspec
index 2921d4b..7bbd105 100644
--- a/oxidized.gemspec
+++ b/oxidized.gemspec
@@ -22,5 +22,6 @@ Gem::Specification.new do |s|
s.add_dependency 'haml'
s.add_dependency 'sass'
s.add_dependency 'slop'
+ s.add_dependency 'asetus', '>= 0.0.5'
end