]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
cloud storage: Fix #10291 Assume that driver ls can return error 1 when the path...
authornorbert.bizet <norbert.bizet@baculasystems.com>
Fri, 15 Dec 2023 10:02:58 +0000 (05:02 -0500)
committerEric Bollengier <eric@baculasystems.com>
Tue, 13 Feb 2024 09:36:03 +0000 (10:36 +0100)
bacula/src/stored/generic_driver.c

index 6cae0bc9542e5d16ba6370e31f926b29c0b46240..877dc02d866ce31bda8f8497ae8aa7f84664fe64 100644 (file)
@@ -1228,6 +1228,16 @@ bool generic_driver::get_cloud_volume_parts_list(const char* volume_name, ilist
    pcb.arg = (void*)&arg;
    int ret = call_fct("ls", volume_name, "part.", &pcb, NULL, cancel_cb, err);
    free_pool_memory(*arg.remain);
+   /* 1 is the generic return code for path not found, except for was driver that always return 0 */
+   if (ret == 1) {
+      err = strip_trailing_junk(err);
+      pm_strcat(err, " Cloud volume ");
+      pm_strcat(err, volume_name);
+      pm_strcat(err, " not found.\n");
+      /* the volume could not be found in the cloud: it's possible to list a Volume on cloud that doesn't exist. 
+         Accept it as an OK behavior */
+      return true;
+   }
    return (ret == 0);
 }