Changeset 1149

Show
Ignore:
Timestamp:
02/14/08 11:14:54 (9 months ago)
Author:
sup
Message:

Fixed bug in get_path: die when called in old way (->get_paths(, 1))

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/api/perl/MogileFS-Client/lib/MogileFS/Client.pm

    r1140 r1149  
    537537    # handle parameters, if any 
    538538    my ($noverify, $zone); 
    539  
     539    unless (ref $opts) { 
     540        $opts = { noverify => $opts }; 
     541    } 
    540542    my %extra_args; 
    541543 
    542     if (ref $opts) { 
    543         $noverify = 1 if $opts->{noverify}; 
    544         $zone = $opts->{zone} || undef; 
    545     } else { 
    546         $noverify = 1 if $opts; 
    547     } 
     544    $noverify = 1 if $opts->{noverify}; 
     545    $zone = $opts->{zone}; 
    548546 
    549547    if (my $pathcount = delete $opts->{pathcount}) { 
    550        $extra_args{pathcount} = $pathcount; 
     548        $extra_args{pathcount} = $pathcount; 
    551549    } 
    552550