From: norbert.bizet Date: Thu, 21 Dec 2023 14:57:16 +0000 (-0500) Subject: cloud: Fix #10291 clean_cloud_volume uses "ls", so we handle its return code the... X-Git-Tag: Release-15.0.2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b741b690a5e063ca49977dc09bbd14f336598a85;p=thirdparty%2Fbacula.git cloud: Fix #10291 clean_cloud_volume uses "ls", so we handle its return code the same way --- diff --git a/bacula/src/stored/generic_driver.c b/bacula/src/stored/generic_driver.c index e8bd9b488..e5bea4432 100644 --- a/bacula/src/stored/generic_driver.c +++ b/bacula/src/stored/generic_driver.c @@ -1123,6 +1123,16 @@ bool generic_driver::clean_cloud_volume(const char *VolumeName, cleanup_cb_type /* list everything in the volume VolumeName */ int ret = call_fct("ls", VolumeName, "", &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, VolumeName); + 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; + } int rtn=0; char *part = NULL;