Index: /trunk/Nebulous-Server/docs/setup.txt
===================================================================
--- /trunk/Nebulous-Server/docs/setup.txt	(revision 19430)
+++ /trunk/Nebulous-Server/docs/setup.txt	(revision 19431)
@@ -32,4 +32,8 @@
     chmod 0770 /data/ipp00?.?/nebulous
     ls -lad /data/ipp00?.?/nebulous
+
+    mkdir /data/`hostname`.0/nebulous
+    chown nobody:nebulous /data/`hostname`.0/nebulous
+    chmod 0770 /data/`hostname`.0/nebulous
 
 =head2 Build and install the Nebulous Perl modules (see: README)
Index: /trunk/Nebulous-Server/lib/Nebulous/Keys.pm
===================================================================
--- /trunk/Nebulous-Server/lib/Nebulous/Keys.pm	(revision 19430)
+++ /trunk/Nebulous-Server/lib/Nebulous/Keys.pm	(revision 19431)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: Keys.pm,v 1.2 2008-07-09 23:32:35 jhoblitt Exp $
+# $Id: Keys.pm,v 1.3 2008-09-09 02:18:47 jhoblitt Exp $
 
 package Nebulous::Keys;
@@ -8,5 +8,5 @@
 use warnings FATAL => qw( all );
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
 
 use base qw( Exporter Class::Accessor::Fast );
@@ -99,5 +99,5 @@
     my $soft_volume;
     # check to see if there is a tilde and remove it if found
-    if (defined $volume and $volume =~ s/^~//) {
+    unless (defined $volume and $volume =~ s/^~//) {
         $soft_volume = 1;
     }
Index: /trunk/Nebulous-Server/lib/Nebulous/Server.pm
===================================================================
--- /trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 19430)
+++ /trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 19431)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004-2008  Joshua Hoblitt
 #
-# $Id: Server.pm,v 1.83 2008-08-21 02:26:58 jhoblitt Exp $
+# $Id: Server.pm,v 1.84 2008-09-09 02:18:47 jhoblitt Exp $
 
 package Nebulous::Server;
@@ -150,11 +150,11 @@
         {
             type        => SCALAR|UNDEF,
-            callbacks   => {
-                # check that the volume requested is valid
-                'is valid volume name' => sub {
-                    return 1 if not defined $_[0];
-                    $self->_is_valid_volume_name($_[0])
-                },
-            },
+#            callbacks   => {
+#                # check that the volume requested is valid
+#                'is valid volume name' => sub {
+#                    return 1 if not defined $_[0];
+#                    $self->_is_valid_volume_name($_[0])
+#                },
+#            },
             optional    => 1,
         },
@@ -167,20 +167,23 @@
     $log->debug( "entered - @_" );
 
+    # vol_name overrides the key implied volume
     $key = parse_neb_key($key, $vol_name);
-    # vol_name overrides the key implied volume
-    $vol_name = $key->volume;
-
-    # the key isn't validiated on input for this method so we have to check it
-    # again after parsing the key
-    if (defined $vol_name and not $self->_is_valid_volume_name($vol_name)) {
+
+    if ($vol_name eq "99") {
+        use Data::Dumper;
+        print Dumper($key);
+    }
+
+    # the key's volume can't be validiated on input for this method so we have
+    # to check it after parsing the key
+    if (defined $key->volume
+        and not $key->soft_volume
+        and not $self->_is_valid_volume_name($key->volume)
+    ) {
         $log->logdie("$vol_name is not a valid volume name");
     }
         
-    if (defined $key->soft_volume) {
-        $vol_name = undef;
-    }
-
     my ($vol_id, $vol_host, $vol_path, $vol_xattr)
-        = $self->_get_storage_volume($vol_name);
+        = $self->_get_storage_volume($key->volume, $key->soft_volume);
 
     my $uri;
@@ -330,11 +333,11 @@
         {
             type        => SCALAR|UNDEF,
-            callbacks   => {
-                # check that the volume name requested is valid
-                'is valid volume name' => sub {
-                    return 1 if not defined $_[0];
-                    $self->_is_valid_volume_name($_[0])
-                },
-            },
+#            callbacks   => {
+#                # check that the volume name requested is valid
+#                'is valid volume name' => sub {
+#                    return 1 if not defined $_[0];
+#                    $self->_is_valid_volume_name($_[0])
+#                },
+#            },
             optional    => 1,
         },
@@ -1164,5 +1167,5 @@
     use warnings;
 
-    my $name = shift;
+    my ($name, $soft_volume) = @_;
 
     my ($vol_id, $vol_host, $vol_path, $xattr);
@@ -1178,4 +1181,10 @@
             unless ($rows > 0) {
                 $query->finish;
+
+                # if a volume name was specified, and is soft, and we failed to
+                # find it, fall back to any volume
+                if ($soft_volume) {
+                    return $self->_get_storage_volume;
+                }
                 $log->logdie("storage volume: $name is not available");
             }
Index: /trunk/Nebulous-Server/t/03_server_create_object.t
===================================================================
--- /trunk/Nebulous-Server/t/03_server_create_object.t	(revision 19430)
+++ /trunk/Nebulous-Server/t/03_server_create_object.t	(revision 19431)
@@ -3,5 +3,5 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 03_server_create_object.t,v 1.27 2008-07-10 00:20:02 jhoblitt Exp $
+# $Id: 03_server_create_object.t,v 1.28 2008-09-09 02:18:47 jhoblitt Exp $
 
 use strict;
@@ -353,5 +353,5 @@
 
 eval {
-    $neb->create_object("foo", 'node03');
+    $neb->create_object("foo", '~node03');
 };
 like($@, qr/node03 is not available/, "request volume this is full");
@@ -360,5 +360,5 @@
 
 eval {
-    $neb->create_object("neb://node03/foo");
+    $neb->create_object("neb://~node03/foo");
 };
 like($@, qr/node03 is not available/, "request volume this is full");
@@ -367,5 +367,5 @@
 
 eval {
-    $neb->create_object("foo", 'node04');
+    $neb->create_object("foo", '~node04');
 };
 like($@, qr/node04 is not available/, "request volume with allocate = FALSE, available = FALSE");
@@ -374,5 +374,5 @@
 
 eval {
-    $neb->create_object("neb://node04/foo");
+    $neb->create_object("neb://~node04/foo");
 };
 like($@, qr/node04 is not available/, "request volume with allocate = FALSE, available = FALSE");
@@ -381,5 +381,5 @@
 
 eval {
-    $neb->create_object("foo", 'node05');
+    $neb->create_object("foo", '~node05');
 };
 like($@, qr/node05 is not available/, "request volume with allocate = FALSE , available = TRUE");
@@ -388,5 +388,5 @@
 
 eval {
-    $neb->create_object("neb://node05/foo");
+    $neb->create_object("neb://~node05/foo");
 };
 like($@, qr/node05 is not available/, "request volume with allocate = FALSE , available = TRUE");
@@ -395,5 +395,5 @@
 
 eval {
-    $neb->create_object("foo", 'node06');
+    $neb->create_object("foo", '~node06');
 };
 like($@, qr/node06 is not available/, "request volume with allocate = TRUE, available = FALSE");
@@ -402,5 +402,5 @@
 
 eval {
-    $neb->create_object("neb://node06/foo");
+    $neb->create_object("neb://~node06/foo");
 };
 like($@, qr/node06 is not available/, "request volume with allocate = TRUE, available = FALSE");
@@ -408,8 +408,14 @@
 Test::Nebulous->setup;
 
-eval {
-    $neb->create_object("foo", 99);
-};
-like($@, qr/did not pass the \'is valid volume name\'/, "volume name doesn't exist");
+{
+    ok($neb->create_object("foo", 99));
+}
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->create_object("foo", "~99");
+};
+like($@, qr/is not a valid volume name/, "volume name doesn't exist");
 
 Test::Nebulous->setup;
Index: /trunk/Nebulous-Server/t/04_server_replicate_object.t
===================================================================
--- /trunk/Nebulous-Server/t/04_server_replicate_object.t	(revision 19430)
+++ /trunk/Nebulous-Server/t/04_server_replicate_object.t	(revision 19431)
@@ -3,10 +3,10 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 04_server_replicate_object.t,v 1.14 2008-07-10 00:20:02 jhoblitt Exp $
+# $Id: 04_server_replicate_object.t,v 1.15 2008-09-09 02:18:47 jhoblitt Exp $
 
 use strict;
 use warnings FATAL => qw( all );
 
-use Test::More tests => 25;
+use Test::More tests => 26;
 
 use lib qw( ./t ./lib );
@@ -82,6 +82,6 @@
     # key, $volume
     $neb->create_object("foo");
-    my $uri1 = $neb->replicate_object("foo", "node01");
-    my $uri2 = $neb->replicate_object("foo", "node02");
+    my $uri1 = $neb->replicate_object("foo", "~node01");
+    my $uri2 = $neb->replicate_object("foo", "~node02");
 
     {
@@ -155,9 +155,16 @@
 Test::Nebulous->setup;
 
+{
+    $neb->create_object('foo');
+    ok($neb->replicate_object('foo', 'bar'),'soft fake storage volume');
+}
+
+Test::Nebulous->setup;
+
 eval {
     $neb->create_object('foo');
-    $neb->replicate_object('foo', 'bar');
+    $neb->replicate_object('foo', '~bar');
 };
-like($@, qr/is valid volume name/, 'storage volume does not exist');
+like($@, qr/is not a valid volume name/, 'storage volume does not exist');
 
 Test::Nebulous->setup;
Index: /trunk/Nebulous-Server/t/75_parse_neb_key.t
===================================================================
--- /trunk/Nebulous-Server/t/75_parse_neb_key.t	(revision 19430)
+++ /trunk/Nebulous-Server/t/75_parse_neb_key.t	(revision 19431)
@@ -3,5 +3,5 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 75_parse_neb_key.t,v 1.4 2008-07-09 23:32:35 jhoblitt Exp $
+# $Id: 75_parse_neb_key.t,v 1.5 2008-09-09 02:18:47 jhoblitt Exp $
 
 use strict;
@@ -77,5 +77,5 @@
     is($key->path, 'foo/bar/baz/quix', 'path');
     is($key->volume, 'boing', 'volume name');
-    is($key->soft_volume, undef, 'soft volume name');
+    is($key->soft_volume, 1, 'soft volume name');
 }
 
@@ -85,5 +85,5 @@
     is($key->path, 'foo/bar/baz/quix', 'path');
     is($key->volume, 'boing', 'volume name');
-    is($key->soft_volume, 1, 'soft volume name');
+    is($key->soft_volume, undef, 'soft volume name');
 }
 
@@ -94,5 +94,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'foo', 'volume name');
-    is($key->soft_volume, undef, 'soft volume name');
+    is($key->soft_volume, 1, 'soft volume name');
 }
 
@@ -102,5 +102,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'foo', 'volume name');
-    is($key->soft_volume, undef, 'soft volume name');
+    is($key->soft_volume, 1, 'soft volume name');
 }
 
@@ -110,5 +110,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'foo', 'volume name');
-    is($key->soft_volume, undef, 'soft volume name');
+    is($key->soft_volume, 1, 'soft volume name');
 }
 
@@ -118,5 +118,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'foo', 'volume name');
-    is($key->soft_volume, undef, 'soft volume name');
+    is($key->soft_volume, 1, 'soft volume name');
 }
 
@@ -126,8 +126,8 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'foo', 'volume name');
-    is($key->soft_volume, undef, 'soft volume name');
-}
-
-# URI w/ soft volume name
+    is($key->soft_volume, 1, 'soft volume name');
+}
+
+# URI w/ hard volume name
 {
     my $key = parse_neb_key('neb://~foo/bar/baz/quix/');
@@ -135,5 +135,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'foo', 'volume name');
-    is($key->soft_volume, 1, 'soft volume name');
+    is($key->soft_volume, undef, 'soft volume name');
 }
 
@@ -144,5 +144,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'boing', 'volume name');
-    is($key->soft_volume, undef, 'soft volume name');
+    is($key->soft_volume, 1, 'soft volume name');
 }
 
@@ -152,5 +152,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'boing', 'volume name');
-    is($key->soft_volume, 1, 'soft volume name');
+    is($key->soft_volume, undef, 'soft volume name');
 }
 
@@ -160,5 +160,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'foo', 'volume name');
-    is($key->soft_volume, undef, 'soft volume name');
+    is($key->soft_volume, 1, 'soft volume name');
 }
 
@@ -189,5 +189,5 @@
 }
 
-# URI w/ soft volume name
+# URI w/ hard volume name
 {
     my $key = parse_neb_key('neb://~foo/bar/baz/quix/');
@@ -195,5 +195,5 @@
     is($key->path, 'bar/baz/quix', 'path');
     is($key->volume, 'foo', 'volume name');
-    is($key->soft_volume, 1, 'soft volume name');
+    is($key->soft_volume, undef, 'soft volume name');
 }
 
