Index: /trunk/Nebulous-Server/Changes
===================================================================
--- /trunk/Nebulous-Server/Changes	(revision 17538)
+++ /trunk/Nebulous-Server/Changes	(revision 17539)
@@ -1,6 +1,8 @@
 Revision history for Nebulous
 
+0.09
+    - allow volume name arguments to be undef
+
 0.08 Thu Apr 17 16:08:16 HST 2008
-    - allow Nebulous::Server::create_object() vol_name to be undef
     - set permissions on storage instance directories
 
Index: /trunk/Nebulous-Server/lib/Nebulous/Server.pm
===================================================================
--- /trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 17538)
+++ /trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 17539)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004-2008  Joshua Hoblitt
 #
-# $Id: Server.pm,v 1.61 2008-05-06 02:51:20 jhoblitt Exp $
+# $Id: Server.pm,v 1.62 2008-05-06 22:10:58 jhoblitt Exp $
 
 package Nebulous::Server;
@@ -7,4 +7,5 @@
 use strict;
 use warnings FATAL => qw( all );
+no warnings qw( uninitialized );
 
 our $VERSION = '0.08';
@@ -151,5 +152,8 @@
             callbacks   => {
                 # check that the volume requested is valid
-                'is valid volume name' => sub { $self->_is_valid_volume_name($_[0]) },
+                'is valid volume name' => sub {
+                    return 1 if not defined $_[0];
+                    $self->_is_valid_volume_name($_[0])
+                },
             },
             optional    => 1,
@@ -317,8 +321,11 @@
         },
         {
-            type        => SCALAR,
+            type        => SCALAR|UNDEF,
             callbacks   => {
                 # check that the volume name requested is valid
-                'is valid volume name' => sub { $self->_is_valid_volume_name($_[0]) },
+                'is valid volume name' => sub {
+                    return 1 if not defined $_[0];
+                    $self->_is_valid_volume_name($_[0])
+                },
             },
             optional    => 1,
@@ -910,8 +917,11 @@
         },
         {
-            type        => SCALAR,
+            type        => SCALAR|UNDEF,
             callbacks   => {
                 # check that the volume name requested is valid
-                'is valid volume name' => sub { $self->_is_valid_volume_name($_[0]) },
+                'is valid volume name' => sub {
+                    return 1 if not defined $_[0];
+                    $self->_is_valid_volume_name($_[0])
+                },
             },
             optional    => 1,
Index: /trunk/Nebulous-Server/t/03_server_create_object.t
===================================================================
--- /trunk/Nebulous-Server/t/03_server_create_object.t	(revision 17538)
+++ /trunk/Nebulous-Server/t/03_server_create_object.t	(revision 17539)
@@ -3,10 +3,10 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 03_server_create_object.t,v 1.25 2008-03-20 21:10:14 jhoblitt Exp $
+# $Id: 03_server_create_object.t,v 1.26 2008-05-06 22:10:58 jhoblitt Exp $
 
 use strict;
 use warnings FATAL => qw( all );
 
-use Test::More tests => 67;
+use Test::More tests => 70;
 
 use lib qw( ./t ./lib );
@@ -251,4 +251,17 @@
 Test::Nebulous->setup;
 
+{
+    # undef volume name
+    # OK because the undef is ignored
+    my $uri = $neb->create_object("neb://node01/foo", undef);
+
+    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
+    ok(-e $path, "file exists");
+    ok($neb->find_instances("foo"), 'object key exists');
+    uri_scheme_ok($uri, 'file');
+}
+
+Test::Nebulous->setup;
+
 eval {
     $neb->create_object("foo");
Index: /trunk/Nebulous-Server/t/04_server_replicate_object.t
===================================================================
--- /trunk/Nebulous-Server/t/04_server_replicate_object.t	(revision 17538)
+++ /trunk/Nebulous-Server/t/04_server_replicate_object.t	(revision 17539)
@@ -3,10 +3,10 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 04_server_replicate_object.t,v 1.12 2008-03-20 21:10:14 jhoblitt Exp $
+# $Id: 04_server_replicate_object.t,v 1.13 2008-05-06 22:10:58 jhoblitt Exp $
 
 use strict;
 use warnings FATAL => qw( all );
 
-use Test::More tests => 16;
+use Test::More tests => 19;
 
 use lib qw( ./t ./lib );
@@ -49,4 +49,21 @@
     $neb->create_object("foo");
     my $uri = $neb->replicate_object("foo", "node01");
+
+    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
+    ok(-e $path, "file exists");
+    uri_scheme_ok($uri, 'file');
+
+SKIP: {
+    skip "requires xattr support", 1 unless $test_xattr;
+    is(getfattr($path, 'user.nebulous_key'), 'foo', 'user.nebulous_key xattr');
+}
+}
+
+Test::Nebulous->setup;
+
+{
+    # key, $volume is undef
+    $neb->create_object("foo");
+    my $uri = $neb->replicate_object("foo", undef);
 
     my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
Index: /trunk/Nebulous-Server/t/07_server_find_instances.t
===================================================================
--- /trunk/Nebulous-Server/t/07_server_find_instances.t	(revision 17538)
+++ /trunk/Nebulous-Server/t/07_server_find_instances.t	(revision 17539)
@@ -3,10 +3,10 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 07_server_find_instances.t,v 1.10 2008-03-20 21:10:14 jhoblitt Exp $
+# $Id: 07_server_find_instances.t,v 1.11 2008-05-06 22:10:58 jhoblitt Exp $
 
 use strict;
 use warnings FATAL => qw( all );
 
-use Test::More tests => 15;
+use Test::More tests => 17;
 
 use lib qw( ./t ./lib );
@@ -55,4 +55,16 @@
 
     my $locations = $neb->find_instances('foo', 'node01');
+
+    uri_scheme_ok($locations->[0], 'file');
+    is($uri, $locations->[0], "URIs match");
+}
+
+Test::Nebulous->setup;
+
+{
+    # key, volume
+    my $uri = $neb->create_object('foo', 'node01');
+
+    my $locations = $neb->find_instances('foo', undef);
 
     uri_scheme_ok($locations->[0], 'file');
