[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debian JP master SVN www commits (rev.1073)



=======================================================
Repository: /org/svn.debian.or.jp/repos
  Revision: 1073
  Commiter: yasu
      Date: 2010-08-07 17:12:30 +0900 (土, 07  8月 2010)
=======================================================
Log:

apply for targetnet

=======================================================
Changed:

U   cdn/trunk/gae-surrogates.rb

Modified: cdn/trunk/gae-surrogates.rb
===================================================================
--- cdn/trunk/gae-surrogates.rb	2010-08-06 21:49:38 UTC (rev 1072)
+++ cdn/trunk/gae-surrogates.rb	2010-08-07 08:12:30 UTC (rev 1073)
@@ -43,7 +43,6 @@
 
 begin
   pj = JSON.parse(json)
-
   addr = Hash.new
 
   pj.each do |hs|
@@ -72,6 +71,19 @@
     end
     addr[continent][hostname].push([hs['ip'].split('.').map{|x| x.to_i}, hs['preference']])
 
+
+    targetnet = hs['targetnet']
+    if addr[targetnet]
+    else
+      addr[targetnet] = Hash.new
+    end
+    
+    if addr[targetnet][hostname]
+    else
+      addr[targetnet][hostname] = Array.new
+    end
+    addr[targetnet][hostname].push([hs['ip'].split('.').map{|x| x.to_i}, hs['preference']])
+
   end
 
   addrfile = File.open("addr", 'w')