[ARVADOS] updated: 4805867bc1004ae9d755a6375d592748a7b29585

git at public.curoverse.com git at public.curoverse.com
Mon Nov 17 17:10:37 EST 2014


Summary of changes:
 services/api/app/models/node.rb | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

       via  4805867bc1004ae9d755a6375d592748a7b29585 (commit)
      from  ff7b22c70cd77073d9bdbebac0bf03d43745ed0c (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 4805867bc1004ae9d755a6375d592748a7b29585
Author: Ward Vandewege <ward at curoverse.com>
Date:   Mon Nov 17 17:09:54 2014 -0500

    Be a bit smarter about handling the dynamic dns resolver records for
    compute nodes on api server startup.
    
    refs #4461

diff --git a/services/api/app/models/node.rb b/services/api/app/models/node.rb
index 40b78e9..ab8b197 100644
--- a/services/api/app/models/node.rb
+++ b/services/api/app/models/node.rb
@@ -183,12 +183,17 @@ class Node < ArvadosModel
   # At startup, make sure all DNS entries exist.  Otherwise, slurmctld
   # will refuse to start.
   if @@dns_server_conf_dir and @@dns_server_conf_template and
-      !File.exists? (File.join(@@dns_server_conf_dir, hostname_for_slot(MAX_SLOTS-1)))
+      !File.exists? (File.join(@@dns_server_conf_dir, "#{hostname_for_slot(MAX_SLOTS-1)}.conf"))
     (0..MAX_SLOTS-1).each do |slot_number|
       hostname = hostname_for_slot(slot_number)
-      hostfile = File.join @@dns_server_conf_dir, hostname
+      hostfile = File.join @@dns_server_conf_dir, "#{hostname}.conf"
       if !File.exists? hostfile
-        dns_server_update(hostname, '127.40.4.0')
+        n = Node.where(:slot_number => slot_number).first
+        if n.nil? or n.ip_address.nil?
+          dns_server_update(hostname, '127.40.4.0')
+        else
+          dns_server_update(hostname, n.ip_address)
+        end
       end
     end
   end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list