Changeset 4638
- Timestamp:
- Jul 27, 2005, 5:48:41 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
Nebulous-Server/t/18_client_open.t (modified) (3 diffs)
-
Nebulous/lib/Nebulous/Client.pm (modified) (3 diffs)
-
Nebulous/t/18_client_open.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/t/18_client_open.t
r4440 r4638 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 18_client_open.t,v 1. 2 2005-06-30 02:35:06jhoblitt Exp $5 # $Id: 18_client_open.t,v 1.3 2005-07-28 03:48:41 jhoblitt Exp $ 6 6 7 7 use strict; … … 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 7;12 plan tests => 8; 13 13 14 14 use lib qw( ./t ./lib ); … … 68 68 Test::Nebulous->setup; 69 69 70 { 71 my $neb = Nebulous::Client->new( 72 proxy => "http://$hostport/nebulous", 73 ); 74 $neb->create( "foo" ); 75 $neb->replicate( "foo" ); 76 77 is( $neb->open( "foo", 'write' ), undef, 78 "write to object with multiple instances" ); 79 } 80 81 Test::Nebulous->setup; 82 70 83 eval { 71 84 my $neb = Nebulous::Client->new( -
trunk/Nebulous/lib/Nebulous/Client.pm
r4633 r4638 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Client.pm,v 1.1 7 2005-07-28 01:40:26jhoblitt Exp $3 # $Id: Client.pm,v 1.18 2005-07-28 03:48:41 jhoblitt Exp $ 4 4 5 5 package Nebulous::Client; … … 161 161 } 162 162 163 my $fh = $self->open( $key, ' write' );163 my $fh = $self->open( $key, 'read' ); 164 164 unless ( $fh ) { 165 165 $log->debug( "can't open $key" ); … … 435 435 436 436 if ( $type eq 'write' ) { 437 my $num_instances = scalar @$locations; 438 439 if ( $num_instances > 1 ) { 440 $log->warn( "write not allowed with multiple instances" ); 441 $log->debug( "leaving" ); 442 return undef; 443 } 444 437 445 eval { 438 446 $fh = _get_filehandle( $path, '+<' ); -
trunk/Nebulous/t/18_client_open.t
r4440 r4638 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 18_client_open.t,v 1. 2 2005-06-30 02:35:06jhoblitt Exp $5 # $Id: 18_client_open.t,v 1.3 2005-07-28 03:48:41 jhoblitt Exp $ 6 6 7 7 use strict; … … 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 7;12 plan tests => 8; 13 13 14 14 use lib qw( ./t ./lib ); … … 68 68 Test::Nebulous->setup; 69 69 70 { 71 my $neb = Nebulous::Client->new( 72 proxy => "http://$hostport/nebulous", 73 ); 74 $neb->create( "foo" ); 75 $neb->replicate( "foo" ); 76 77 is( $neb->open( "foo", 'write' ), undef, 78 "write to object with multiple instances" ); 79 } 80 81 Test::Nebulous->setup; 82 70 83 eval { 71 84 my $neb = Nebulous::Client->new(
Note:
See TracChangeset
for help on using the changeset viewer.
