summaryrefslogtreecommitdiff
path: root/lib/oxidized/nodes.rb
diff options
context:
space:
mode:
authorElvin Efendi <elvin.efendiev@shopify.com>2015-12-09 23:43:32 -0500
committerElvin Efendi <elvin.efendiev@shopify.com>2015-12-13 19:02:36 -0500
commit1c4f886e883f947b649613a21955929fa6d7e94c (patch)
treef505d91af55ee18837d0290f3d9ea7ff8531240b /lib/oxidized/nodes.rb
parent82db9fdd9c135a445a4839e39b245a9965091219 (diff)
refactor and fix bugs introduced with new changes
Diffstat (limited to 'lib/oxidized/nodes.rb')
-rw-r--r--lib/oxidized/nodes.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb
index f0c5d56..0c02d7a 100644
--- a/lib/oxidized/nodes.rb
+++ b/lib/oxidized/nodes.rb
@@ -1,8 +1,8 @@
module Oxidized
- require 'ipaddr'
- require 'oxidized/node'
- class Oxidized::NotSupported < OxidizedError; end
- class Oxidized::NodeNotFound < OxidizedError; end
+ require 'ipaddr'
+ require 'oxidized/node'
+ class Oxidized::NotSupported < OxidizedError; end
+ class Oxidized::NodeNotFound < OxidizedError; end
class Nodes < Array
attr_accessor :source
alias :put :unshift
@@ -18,13 +18,13 @@ module Oxidized
_node = Node.new node
new.push _node
rescue ModelNotFound => err
- Log.error "node %s raised %s with message '%s'" % [node, err.class, err.message]
+ Oxidized.logger.error "node %s raised %s with message '%s'" % [node, err.class, err.message]
rescue Resolv::ResolvError => err
- Log.error "node %s is not resolvable, raised %s with message '%s'" % [node, err.class, err.message]
+ Oxidized.logger.error "node %s is not resolvable, raised %s with message '%s'" % [node, err.class, err.message]
end
end
size == 0 ? replace(new) : update_nodes(new)
- Log.info "Loaded #{size} nodes"
+ Oxidized.logger.info "Loaded #{size} nodes"
end
end
@@ -148,9 +148,9 @@ module Oxidized
end
end
end
-
+
public
-
+
def version node, group
with_lock do
i = find_node_index node
@@ -159,7 +159,7 @@ module Oxidized
output.version node, group
end
end
-
+
def get_version node, group, oid
with_lock do
i = find_node_index node
@@ -168,7 +168,7 @@ module Oxidized
output.get_version node, group, oid
end
end
-
+
def get_diff node, group, oid1, oid2
with_lock do
i = find_node_index node