summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2017-01-12 15:43:28 +0200
committerSaku Ytti <saku@ytti.fi>2017-01-12 15:43:28 +0200
commit691141d90dfdf982e98b02eab7e8938a95dd5855 (patch)
tree25fbc4801c5c08e6133964ce15a114d432588663
parent571b77d285afe6a9085369d46b4c57ebd58a5ca1 (diff)
guard adding job via configuration option
-rw-r--r--lib/oxidized/config.rb5
-rw-r--r--lib/oxidized/nodes.rb2
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/oxidized/config.rb b/lib/oxidized/config.rb
index b6b5c40..aba8b63 100644
--- a/lib/oxidized/config.rb
+++ b/lib/oxidized/config.rb
@@ -28,8 +28,9 @@ module Oxidized
asetus.default.retries = 3
asetus.default.prompt = /^([\w.@-]+[#>]\s?)$/
asetus.default.rest = '127.0.0.1:8888' # or false to disable
- asetus.default.vars = {} # could be 'enable'=>'enablePW'
- asetus.default.groups = {} # group level configuration
+ asetus.default.next_adds_job = false # if true, /next adds job, so device is fetched immmeiately
+ asetus.default.vars = {} # could be 'enable'=>'enablePW'
+ asetus.default.groups = {} # group level configuration
asetus.default.pid = File.join(Oxidized::Config::Root, 'pid')
asetus.default.input.default = 'ssh, telnet'
diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb
index 011bfc3..72a2dc4 100644
--- a/lib/oxidized/nodes.rb
+++ b/lib/oxidized/nodes.rb
@@ -73,7 +73,7 @@ module Oxidized
# set last job to nil so that the node is picked for immediate update
n.last = nil
put n
- jobs.want += 1
+ jobs.want += 1 if Config.next_adds_job
end
end
end