Index: trunk/Nebulous-Server/lib/Nebulous/Server.pm
===================================================================
--- trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 19144)
+++ 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");
             }
