]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
cloud: reapply usefull previous changes
authornorbert.bizet <norbert.bizet@baculasystems.com>
Thu, 21 Dec 2023 14:55:07 +0000 (09:55 -0500)
committerEric Bollengier <eric@baculasystems.com>
Wed, 4 Dec 2024 08:14:26 +0000 (09:14 +0100)
bacula/scripts/aws_cloud_driver.in
bacula/src/stored/cloud_dev.c
bacula/src/stored/dircmd.c

index 82789391b0bf0fc2a598f00ca68f406d764ee31c..124bdb54988c2ceae80cf4b684ac82b4f4bbccd0 100755 (executable)
@@ -92,9 +92,6 @@ def ls():
          # forward out stds
          logging.info("ls outputing {0}".format(output))
          sys.stdout.write(output)
-      if proc.returncode == 1:
-         # possible to ls unexisting path. In this case, return code will be 1.
-         return 0
       return proc.returncode
    except Exception as e:
       exc = traceback.format_exception_only(type(e), e)[0]
index 2bb1bb018ee04f8ce7d9d5613f77a85ef3c6f455..5fa29f7415afce39f89876afd1bdcf43a1634a90 100644 (file)
@@ -2814,13 +2814,17 @@ bool cloud_dev::upload_cache(DCR *dcr, const char *VolumeName, uint32_t truncate
       Mmsg(fname, "%s/part.%d", vol_dir, i);
       Dmsg1(dbglvl, "Do upload of %s\n", fname);
       bool do_truncate = (truncate==TRUNC_AFTER_UPLOAD) || (truncate==TRUNC_CONF_DEFAULT && (trunc_opt == TRUNC_AFTER_UPLOAD));
-      if (!upload_part_to_cloud(dcr, VolumeName, i, do_truncate)) {
-         if (errmsg[0]) {
-            Qmsg(dcr->jcr, M_ERROR, 0, "%s", errmsg);
+      if (cache_parts[i]) {
+         if (!upload_part_to_cloud(dcr, VolumeName, i, do_truncate)) {
+            if (errmsg[0]) {
+               Qmsg(dcr->jcr, M_ERROR, 0, "%s", errmsg);
+            }
+            ret = false;
+         } else {
+            Qmsg(dcr->jcr, M_INFO, 0, "Uploaded cache %s\n", fname);
          }
-         ret = false;
       } else {
-         Qmsg(dcr->jcr, M_INFO, 0, "Uploaded cache %s\n", fname);
+         Qmsg(dcr->jcr, M_WARNING, 0, "Part %s not found in cache. Upload skipped.\n", fname);
       }
    }
 bail_out:
index 8fb8710e7f22cb288730e899a4bd74740eef5501..062fc8b9d864a64d0f768bcb9c1c61d8169de2c2 100644 (file)
@@ -840,7 +840,7 @@ static bool cloud_list_cmd(JCR *jcr)
    } else {
       ilist parts(100, not_owned_by_alist);
       if (!dcr->dev->get_cloud_volume_parts_list(dcr, volname, &parts, errmsg)) {
-         dir->fsend(_("3900 Error cannot get cloud Volume list. ERR=%s\n"), errmsg);
+         dir->fsend(_("3900 Error cannot get cloud parts list. ERR=%s\n"), errmsg);
          free_dcr(dcr);
          goto bail_out;
       }