[pve-devel] [PATCH storage 1/2] activate storage: improve error when check_connection dies

Fabian Ebner f.ebner at proxmox.com
Mon Nov 15 13:37:55 CET 2021


by making sure the storage ID is part of the error. This can happen
for (at least) CIFS, and GlusterFS with local server.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/Storage.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index d64019f..40972c9 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -1056,7 +1056,8 @@ sub activate_storage {
 	activate_storage($cfg, $baseid, $cache);
     }
 
-    if (!$plugin->check_connection($storeid, $scfg)) {
+    if (! eval { $plugin->check_connection($storeid, $scfg) }) {
+	die "connection check for storage '$storeid' failed - $@\n" if $@;
 	die "storage '$storeid' is not online\n";
     }
 
-- 
2.30.2





More information about the pve-devel mailing list