summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-08-16 12:12:07 +0300
committerSaku Ytti <saku@ytti.fi>2014-08-16 12:12:07 +0300
commitc85133df29bb3dbe259b876a223056e4aef01010 (patch)
tree629eaf656003e9e6cf7e5f59dcb27106f563f762
parentf076641f0183ac902019e741feda7474b2c1fdc9 (diff)
parent3ee2f961bc3cb615435e53d1c1f23838f9d4856f (diff)
Merge branch 'master' into cfg_as_object
-rw-r--r--lib/oxidized/config.rb2
-rw-r--r--lib/oxidized/log.rb1
-rw-r--r--lib/oxidized/nodes.rb1
3 files changed, 3 insertions, 1 deletions
diff --git a/lib/oxidized/config.rb b/lib/oxidized/config.rb
index ddfde81..96c8fbf 100644
--- a/lib/oxidized/config.rb
+++ b/lib/oxidized/config.rb
@@ -51,6 +51,6 @@ module Oxidized
Log.level = Logger::INFO unless CFG.debug
raise NoConfig, 'edit ~/.config/oxidized/config' if CFGS.create
- Log.file = CFG.log if CFG.log
+ Log.file = CFG.log if CFG.log
end
diff --git a/lib/oxidized/log.rb b/lib/oxidized/log.rb
index 9e77646..e9ae1b4 100644
--- a/lib/oxidized/log.rb
+++ b/lib/oxidized/log.rb
@@ -12,6 +12,7 @@ module Oxidized
super target
end
def file= target
+ FileUtils.mkdir_p File.dirname(target)
@logdev = LogDevice.new target
end
end
diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb
index d6cc867..6f30af4 100644
--- a/lib/oxidized/nodes.rb
+++ b/lib/oxidized/nodes.rb
@@ -28,6 +28,7 @@ module Oxidized
Log.error "node %s is not resolvable, raised %s with message '%s'" % [node, err.class, err.message]
end
end
+ Log.info "Loaded #{size} nodes"
size == 0 ? replace(new) : update_nodes(new)
end
end