]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Improve volume truncation error messages
authorKern Sibbald <kern@sibbald.com>
Fri, 16 Nov 2018 11:45:02 +0000 (12:45 +0100)
committerKern Sibbald <kern@sibbald.com>
Fri, 16 Nov 2018 11:45:02 +0000 (12:45 +0100)
bacula/src/dird/ua_purge.c

index 6d85b91950ef93510ddf0935bbd9c9ce00a45652..d63fbf7c7abb8dff1f5ee504cff9aafcf3fc8159 100644 (file)
@@ -590,7 +590,7 @@ static void truncate_volume(UAContext *ua, MEDIA_DBR *mr,
    /* Do it only if action on purge = truncate is set */
    if (!(mr->ActionOnPurge & ON_PURGE_TRUNCATE)) {
       ua->error_msg(_("\nThe option \"Action On Purge = Truncate\" was not defined in the Pool resource.\n"
-                      "Unable to truncate volume \"%s\"\n"), mr->VolumeName);
+                      "Truncate not allowd on Volume \"%s\"\n"), mr->VolumeName);
       return;
    }
 
@@ -625,7 +625,7 @@ static void truncate_volume(UAContext *ua, MEDIA_DBR *mr,
       if (sscanf(sd->msg, "3000 OK label. VolBytes=%llu VolABytes=%lld VolType=%d ",
                  &VolBytes, &VolABytes, &VolType) == 3) {
 
-         ok=true;
+         ok = true;
          mr->VolBytes = VolBytes;
          mr->VolABytes = VolABytes;
          mr->VolType = VolType;
@@ -636,13 +636,15 @@ static void truncate_volume(UAContext *ua, MEDIA_DBR *mr,
 
          set_storageid_in_mr(NULL, mr);
          if (!db_update_media_record(ua->jcr, ua->db, mr)) {
-            ua->error_msg(_("Can't update volume size in the catalog\n"));
+            ua->error_msg(_("Can't update volume size in the catalog for Volume \"%s\"\n"),
+               mr->VolumeName);
+            ok = false;
          }
          ua->send_msg(_("The volume \"%s\" has been truncated\n"), mr->VolumeName);
       }
    }
    if (!ok) {
-      ua->warning_msg(_("Unable to truncate volume \"%s\"\n"), mr->VolumeName);
+      ua->warning_msg(_("Error truncating Volume \"%s\"\n"), mr->VolumeName);
    }
 }