Index: trunk/Nebulous-Server/lib/Nebulous/Server/Config.pm
===================================================================
--- trunk/Nebulous-Server/lib/Nebulous/Server/Config.pm	(revision 16282)
+++ trunk/Nebulous-Server/lib/Nebulous/Server/Config.pm	(revision 17072)
@@ -1,5 +1,5 @@
 # Copyright (C) 2005  Joshua Hoblitt
 #
-# $Id: Config.pm,v 1.2 2006-12-12 00:06:27 jhoblitt Exp $
+# $Id: Config.pm,v 1.3 2008-03-20 21:10:57 jhoblitt Exp $
 
 package Nebulous::Server::Config;
@@ -12,6 +12,16 @@
 use base qw( Class::Accessor::Fast );
 
-use Nebulous::Util qw( %LEVELS );
+use Log::Log4perl qw( :levels );
 use Params::Validate qw( validate SCALAR );
+
+our %LEVELS = (
+    off     => $OFF,
+    fatal   => $FATAL,
+    error   => $ERROR,
+    warn    => $WARN,
+    info    => $INFO,
+    debug   => $DEBUG,
+    all     => $ALL,
+);
 
 my $new_validate = {
Index: trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
===================================================================
--- trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 16282)
+++ trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 17072)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: SQL.pm,v 1.48 2008-02-02 02:10:52 jhoblitt Exp $
+# $Id: SQL.pm,v 1.49 2008-03-20 21:10:57 jhoblitt Exp $
 
 package Nebulous::Server::SQL;
@@ -246,18 +246,19 @@
     find_objects_with_unavailable_instances => qq{
         SELECT
-            so_id,
+            storage_object.so_id,
             ext_id,
             count(ins_id) as instances,
             count(mountedvol.vol_id) as available_instances,
             count(mountedvol.vol_id) < count(ins_id) as need_recovery,
-            count(mountedvol.vol_id) > 0 as recoverable
+            count(mountedvol.vol_id) > 0 as recoverable,
+            storage_object_xattr.value as copies
         FROM storage_object
         JOIN storage_object_attr
             USING(so_id)
-        JOIN storage_object_xattr
+        JOIN instance
+            USING(so_id)
+        LEFT JOIN storage_object_xattr
             ON storage_object.so_id = storage_object_xattr.so_id
             AND storage_object_xattr.name = 'copies'
-        JOIN instance
-            USING(so_id)
         LEFT JOIN mountedvol
             USING(vol_id)
