]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Omit logging info about StorageGroup when it contains only 1 item
authorMichal Rakowski <michal.rakowski@baculasystems.com>
Fri, 4 Jun 2021 08:37:37 +0000 (10:37 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:02 +0000 (09:03 +0100)
bacula/src/dird/backup.c

index 8f782fdced70935b16907d8a181ea0f4c159053a..686d9af59e8ccc2f3ff72bea702ea6a3eabed7ee 100644 (file)
@@ -598,12 +598,15 @@ bool do_backup(JCR *jcr)
       }
 
       if(sd_job_started) {
+         /* No need to print msg when there is only 1 storage defined in the original group */
          int group_size = jcr->store_mngr->get_origin_wstore_list()->size();
-         Jmsg(jcr, M_INFO, 0,
-              "Storage \"%s\" was selected out of group of %d available storages. "
-              "StorageGroupPolicy used: \"%s\"",
-              jcr->store_mngr->get_wstore()->name(), group_size,
-              jcr->store_mngr->get_policy_name());
+         if (group_size > 1) {
+            Jmsg(jcr, M_INFO, 0,
+                  "Storage \"%s\" was selected out of group of %d available storages. "
+                  "StorageGroupPolicy \"%s\" used\n",
+                  jcr->store_mngr->get_wstore()->name(), group_size,
+                  jcr->store_mngr->get_policy_name());
+         }
          /* We can decrement not-used SDs since job was started against first available storage from the list */
          jcr->store_mngr->dec_unused_wstores();