Commits

Hideya OHASHI committed 6a2abe6

rename to icedfs

Comments (0)

Files changed (2)

             rep += 1
           else
             if count > 0
-              puts "warning: #{datanode} should have #{chunk}" unless quiet
+              unless quiet
+                puts "warning: #{datanode} should have #{chunk[0,12]}"
+              end
               unbalance += 1
             end
           end
           count -= 1
         end
         if rep == 0
-          puts "error: missing #{chunk}" unless quiet
+          puts "error: missing #{chunk[0,12]}" unless quiet
           missing += 1
         elsif rep < 2
-          puts "warning: no replication #{chunk}" unless quiet
+          puts "warning: no replication #{chunk[0,12]}" unless quiet
           replication += 1
         elsif rep > 2
           overrep += 1
     fname = tmp.path
     FileUtils.rm_f(fname)
     return nil unless system(
-        "scp #{@host}:#{@path}/chunk/#{digest} #{fname} >/dev/null")
+        "scp #{@host}:#{@path}/chunk/#{digest} #{fname} >/dev/null 2>/dev/null")
     begin
       IO.read(fname) # FIXME use binary mode
     rescue Errno::ENOENT
       open("/tmp/sha256.txt", 'r') do |f|
         f.each_line do |l|
           digest, file = l.split
-          if digest.index(file) < 0
+          unless file.index(digest)
             unless quiet
               puts "#{@url} has a bad chunk." # TODO fix when?
               puts file
 cmd = ARGV.shift
 opt = OptionParser.new
 
-CONFIGFILE = "#{ENV['HOME']}/.sdfs.yaml"
+CONFIGFILE = "#{ENV['HOME']}/.icedfs.yaml"
 dfs = DFS.new
 dfs.loadconfig(CONFIGFILE) if File.exist?(CONFIGFILE)