[pve-devel] r4876 - pve-storage/pve2

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Jul 6 10:17:11 CEST 2010


Author: dietmar
Date: 2010-07-06 08:17:10 +0000 (Tue, 06 Jul 2010)
New Revision: 4876

Modified:
   pve-storage/pve2/Storage.pm
Log:
better error messages


Modified: pve-storage/pve2/Storage.pm
===================================================================
--- pve-storage/pve2/Storage.pm	2010-07-05 11:56:23 UTC (rev 4875)
+++ pve-storage/pve2/Storage.pm	2010-07-06 08:17:10 UTC (rev 4876)
@@ -938,6 +938,8 @@
 sub storage_config {
     my ($cfg, $storeid, $noerr) = @_;
 
+    die "no storage id specified\n" if !$storeid;
+ 
     my $scfg = $cfg->{ids}->{$storeid};
 
     die "storage '$storeid' does not exists\n" if (!$noerr && !$scfg);
@@ -1813,7 +1815,7 @@
 sub template_list {
     my ($cfg, $storeid, $tt) = @_;
 
-    die "unknown template type" if !($tt eq 'iso' || $tt eq 'vztmpl' || $tt eq 'backup'); 
+    die "unknown template type '$tt'\n" if !($tt eq 'iso' || $tt eq 'vztmpl' || $tt eq 'backup'); 
 
     my $ids = $cfg->{ids};
 
@@ -1847,7 +1849,7 @@
 	    } elsif ($tt eq 'backup') {
 		$path = $scfg->{path};
 	    } else {
-		die "unknown template type";
+		die "unknown template type '$tt'\n";
 	    }
 
 	    foreach my $fn (<$path/*>) {




More information about the pve-devel mailing list