[ARVADOS] updated: 56ec5cfb4ee8c4d5a00bfd031e4c79c5e2263762

git at public.curoverse.com git at public.curoverse.com
Wed Dec 31 10:01:36 EST 2014


Summary of changes:
 sdk/python/bin/arv-get          |  2 +-
 services/api/app/models/node.rb | 16 +++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

       via  56ec5cfb4ee8c4d5a00bfd031e4c79c5e2263762 (commit)
       via  a1d0dc23b205d8593b31a4696260e5ef680ec72c (commit)
       via  e3087e7d734515124df0aef78389d9981264b5db (commit)
       via  c7112a98dca78b2e3cc892e0c5f0f02071ac6e50 (commit)
      from  b06785a74d28149b92f289d56fa55914375ddfcf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 56ec5cfb4ee8c4d5a00bfd031e4c79c5e2263762
Merge: a1d0dc2 e3087e7
Author: Ward Vandewege <ward at curoverse.com>
Date:   Wed Dec 31 10:01:30 2014 -0500

    Merge branch 'master' into 4887-invalidate-duplicate-ip-on-old-compute-nodes


commit a1d0dc23b205d8593b31a4696260e5ef680ec72c
Author: Ward Vandewege <ward at curoverse.com>
Date:   Wed Dec 31 10:00:21 2014 -0500

    Address review comments:
    
    * change stale_conflicting_nodes to a local variable
    * minor performance optimization: add an additional check for ip_address being nil
    
    refs #4887

diff --git a/services/api/app/models/node.rb b/services/api/app/models/node.rb
index 3bc2586..c38f681 100644
--- a/services/api/app/models/node.rb
+++ b/services/api/app/models/node.rb
@@ -137,13 +137,15 @@ class Node < ArvadosModel
 
   def dns_server_update
     if self.hostname_changed? or self.ip_address_changed?
-      @stale_conflicting_nodes = Node.where('id != ? and ip_address = ? and last_ping_at < ?',self.id,self.ip_address,10.minutes.ago)
-      if not @stale_conflicting_nodes.empty?
-        # One or more stale compute node records have the same IP address as the new node.
-        # Clear the ip_address field on the stale nodes.
-        @stale_conflicting_nodes.each do |stale_node|
-          stale_node.ip_address = nil
-          stale_node.save!
+      if not self.ip_address.nil?
+        stale_conflicting_nodes = Node.where('id != ? and ip_address = ? and last_ping_at < ?',self.id,self.ip_address,10.minutes.ago)
+        if not stale_conflicting_nodes.empty?
+          # One or more stale compute node records have the same IP address as the new node.
+          # Clear the ip_address field on the stale nodes.
+          stale_conflicting_nodes.each do |stale_node|
+            stale_node.ip_address = nil
+            stale_node.save!
+          end
         end
       end
       if self.hostname and self.ip_address

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list