summaryrefslogtreecommitdiff
path: root/lib/oxidized/source/source.rb
diff options
context:
space:
mode:
authornertwork <webmaster@nertwork.com>2016-12-20 10:49:24 -0800
committernertwork <webmaster@nertwork.com>2016-12-20 10:49:24 -0800
commite0621bbb81daab0de9fccc031c3e875031c2b67b (patch)
tree9b527895c0a07d216f67728526b0ed7f82a40d12 /lib/oxidized/source/source.rb
parentbcdd40d552cbf5e32dafebf4e531d407eb85bc84 (diff)
parent1466f0f635d1e014ea993179729306d3a9a8d381 (diff)
Merge remote-tracking branch 'upstream/master'
* upstream/master: (109 commits) delete secret password if it is called secret bump up version update changelogs Recursively search from one dir above specified Fix suggested by ytti for issue #610 Remove trailing whitespace and enable prompt detection Update eos.rb exclude time from output New hook: awssns - Publish messages to AWS SNS topics Updated config options Added option to disable ssl verification checks for http source Update ciscosmb.rb Update ciscosmb.rb Update ciscosmb.rb expect prompt after entering enable password add support for PLANET SG switches renamed alvarion -> alvarion.rb This adds support for Hatteras Networks devices This adds support for D-Link switches This adds support for the Casa C1G CMTS ...
Diffstat (limited to 'lib/oxidized/source/source.rb')
-rw-r--r--lib/oxidized/source/source.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/oxidized/source/source.rb b/lib/oxidized/source/source.rb
index 7862dd1..9b8bc94 100644
--- a/lib/oxidized/source/source.rb
+++ b/lib/oxidized/source/source.rb
@@ -1,11 +1,23 @@
module Oxidized
class Source
class NoConfig < OxidizedError; end
+
def initialize
@map = (Oxidized.config.model_map or {})
end
+
def map_model model
@map.has_key?(model) ? @map[model] : model
end
+
+ def node_var_interpolate var
+ case var
+ when "nil" then nil
+ when "false" then false
+ when "true" then true
+ else var
+ end
+ end
+
end
end