IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24996 for trunk/Nebulous/lib


Ignore:
Timestamp:
Aug 4, 2009, 11:42:45 AM (17 years ago)
Author:
jhoblitt
Message:

add neb-cull --one_only flag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/lib/Nebulous/Client.pm

    r24930 r24996  
    297297        my $instances = $stats[6];
    298298        if (defined $instances and $instances < 2) {
    299             $log->debug("can not cull - not enough instances");
     299            $self->set_err("can not cull - not enough instances");
    300300            $log->debug("leaving");
    301301
     
    305305        $locations = $self->find_instances($key, $vol_name);
    306306        unless (defined $locations) {
    307             $log->debug( "no instances" );
     307            $self->set_err( "no instances" );
    308308            $log->debug( "leaving" );
    309309
     
    313313        $locations = $self->find_instances($key);
    314314        unless ($locations) {
    315             $log->debug("no instances");
     315            $self->set_err( "no instances" );
    316316            $log->debug("leaving");
    317317
     
    320320
    321321        if (scalar @{ $locations } < 2) {
    322             $log->debug("can not cull - not enough instances");
     322            $self->set_err("can not cull - not enough instances");
    323323            $log->debug("leaving");
    324324
     
    365365        if (not defined $self->prune($key)) {
    366366            # use the prune() method to also determine if $key is valid
    367             $removed = undef;
    368             return;
     367            die "invalid key: $key";
    369368        }
    370369
     
    377376        if (defined $locations) {
    378377            my $instances = $self->find_instances($key);
     378            if (scalar @$instances < 2) {
     379                die "not enough instances";
     380            }
    379381            foreach my $victim (@$instances) {
    380382                next if $victim eq $locations->[0];
     
    387389            # start at one so cull() is called one less time then the # of
    388390            # instances
     391            if ($stats->[6] < 2) {
     392                die "not enough instances";
     393            }
    389394            for (my $i = 1; $i < $stats->[6]; $i++) {
    390395                $self->cull($key);
     
    395400    };
    396401    if ($@) {
     402        if ($@ =~ qr/invalid key/) {
     403            $self->set_err($@);
     404            return;
     405        }
    397406        $log->logdie($@);
    398407    }
Note: See TracChangeset for help on using the changeset viewer.