Changeset 16232
- Timestamp:
- Jan 25, 2008, 10:54:04 AM (18 years ago)
- Location:
- trunk/Nebulous
- Files:
-
- 3 edited
-
bin/neb-touch (modified) (2 diffs)
-
lib/Nebulous/Client.pm (modified) (2 diffs)
-
t/64_client_find_objects.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/bin/neb-touch
r16225 r16232 3 3 # Copyright (C) 2007-2008 Joshua Hoblitt 4 4 # 5 # $Id: neb-touch,v 1. 6 2008-01-25 02:44:49jhoblitt Exp $5 # $Id: neb-touch,v 1.7 2008-01-25 20:54:04 jhoblitt Exp $ 6 6 7 7 use strict; … … 40 40 unless defined $neb; 41 41 42 43 unless ($neb->find_objects($file)) { 44 $neb->create($file, $volume) 45 or die "failed to create Nebulous key $file"; 42 unless (scalar @{$neb->find_objects($file)}) { 43 if (defined $volume) { 44 $neb->create($file, $volume) 45 or die "failed to create Nebulous key $file"; 46 } else { 47 $neb->create($file) 48 or die "failed to create Nebulous key $file"; 49 } 46 50 } 47 51 -
trunk/Nebulous/lib/Nebulous/Client.pm
r16227 r16232 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Client.pm,v 1.3 7 2008-01-25 02:54:53jhoblitt Exp $3 # $Id: Client.pm,v 1.38 2008-01-25 20:54:04 jhoblitt Exp $ 4 4 5 5 package Nebulous::Client; … … 420 420 $log->debug( "leaving" ); 421 421 422 # aparently empty arrays are being turned into undef by SOAP::Lite so the 423 # behavior of this function is different then it's ::Server counter part 424 425 return scalar @$keys ? $keys : undef; 422 # note that no keys found is returned as [] 423 424 return $keys; 426 425 } 427 426 -
trunk/Nebulous/t/64_client_find_objects.t
r13048 r16232 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 64_client_find_objects.t,v 1. 1 2007-04-27 00:09:22jhoblitt Exp $5 # $Id: 64_client_find_objects.t,v 1.2 2008-01-25 20:54:04 jhoblitt Exp $ 6 6 7 7 use strict; … … 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 6;12 plan tests => 7; 13 13 14 14 use lib qw( ./t ./lib ); … … 31 31 my $keys = $neb->find_objects(); 32 32 33 is($keys, undef, 'number of keys found'); 33 # undef indicates an error 34 is($keys, undef, 'undef is an error'); 34 35 } 35 36 … … 67 68 Test::Nebulous->setup; 68 69 70 { 71 # key does not exist 72 my $neb = Nebulous::Client->new( 73 proxy => "http://$hostport/nebulous", 74 ); 75 76 my $keys = $neb->find_objects( "bar" ); 77 78 is_deeply($keys, [], 'number of keys found'); 79 } 80 81 Test::Nebulous->setup; 82 69 83 eval { 70 84 my $neb = Nebulous::Client->new(
Note:
See TracChangeset
for help on using the changeset viewer.
