Changeset 34943

Show
Ignore:
Timestamp:
01/16/13 15:41:12 (5 years ago)
Author:
schastel
Message:

Merge tag into trunk

Location:
trunk/Nebulous-Server
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server

    • Property svn:mergeinfo
      •  

        old new  
        1616/branches/eam_branches/ipp-20121130/Nebulous-Server:34755-34841 
        1717/branches/haf_add201112/Nebulous-Server:32980-33029 
        18 /tags/ipp-20121218/Nebulous-Server:34853-34928 
         18/tags/ipp-20121218/Nebulous-Server:34853-34942 
  • trunk/Nebulous-Server/bin/nebdiskd

    r34929 r34943  
    362362    $df_data =~ s/\s+/:/g; 
    363363    $log->debug("Received from ssh = [$df_data]"); 
     364    my %df_info = (); 
     365    $df_info{"blocks"} = 0; 
     366    $df_info{"used"} = 0; 
    364367    unless ($df_data) { 
     368        # We cannot connect to the host for some reason However, the 
     369        # partition can be mounted on some other hosts (in the case of 
     370        # an original host failure or upgrade for instance) Let's look 
     371        # for an entry in /etc/autofs/auto.data starting with 
     372        # <hostname>.[012] If it's in there, return (blocks => 1, used 
     373        # => 1). The partition is mounted but not available for 
     374        # replication (since blocks-used = 0 and used/blocks=1=100%). 
     375        my $partition_name = $mountpoint; 
     376        $partition_name =~ s/\/export\///; 
     377        $log->debug("Looking for $partition_name in /etc/autofs/auto.data"); 
     378        open(AUTODATA, "</etc/autofs/auto.data") or die("Can't open /etc/autofs/auto.data"); 
     379        foreach my $line (<AUTODATA>) { 
     380            if ($line =~ /^$partition_name/) { 
     381                $log->debug("$partition_name found in /etc/autofs/auto.data"); 
     382                close(AUTODATA); 
     383                $df_info{"blocks"} = 1; 
     384                $df_info{"used"} = 1; 
     385                return \%df_info; 
     386            } 
     387        } 
     388        $log->debug("$partition_name NOT found in /etc/autofs/auto.data"); 
     389        close(AUTODATA); 
    365390        return undef; 
    366391    } 
    367392    my @data = split(/:/, $df_data); 
    368     my %df_info = (); 
    369393    $df_info{"blocks"} = $data[1]; 
    370394    $df_info{"used"} = $data[2];