IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26333 for trunk/Nebulous/lib


Ignore:
Timestamp:
Dec 3, 2009, 3:31:01 PM (17 years ago)
Author:
watersc1
Message:

Changes to implement delete-invalid. Probably not 100% production ready.

File:
1 edited

Legend:

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

    r26292 r26333  
    755755            optional    => 1,
    756756        },
     757        {
     758            #find_invalid
     759            type        => SCALAR|UNDEF,
     760            optional    => 1,
     761        },
    757762    );
    758763
     
    951956    my $self = shift;
    952957
    953     my ($key, $force) = validate_pos( @_,
     958    my ($key, $force, $invalid) = validate_pos( @_,
    954959        {
    955960            type        => SCALAR,
     
    965970            },
    966971        },
    967     );
    968 
    969     $log->debug( "entered - @_" );
    970 
    971     my $locations = $self->find_instances( $key, 'any' );
     972        {
     973            type        => BOOLEAN,
     974            optional    => 1,
     975            default     => undef,
     976            callbacks   => {
     977                'is boolean' => sub {
     978                    $_[0] == 0 or $_[0] == 1 or $_[0] == undef;
     979                },
     980            },
     981        },
     982    );
     983
     984    $log->debug( "entered - @_" );
     985
     986
     987    my $locations;
     988    if ($invalid) {
     989        $locations = $self->find_instances( $key, 'any', 'find them all');
     990    }
     991    else {
     992        $locations = $self->find_instances( $key, 'any' );
     993    }
    972994
    973995    return undef unless $locations;
Note: See TracChangeset for help on using the changeset viewer.