]> git.sur5r.net Git - bacula/bacula/commitdiff
Display correct NextPool overrides + use Job NextPool in restore if available
authorKern Sibbald <kern@sibbald.com>
Thu, 12 Jun 2014 08:39:58 +0000 (10:39 +0200)
committerKern Sibbald <kern@sibbald.com>
Thu, 12 Jun 2014 08:39:58 +0000 (10:39 +0200)
bacula/src/dird/job.c
bacula/src/dird/ua_run.c

index fa667d40dbab3c59b0104c7220bc37e9ae297d5e..985469926783f7943d9b1046032adea634cfeb85 100644 (file)
@@ -945,13 +945,13 @@ bool apply_wstorage_overrides(JCR *jcr, POOL *opool)
    if (jcr->run_next_pool_override) {
       pm_strcpy(jcr->next_pool_source, _("Run NextPool override"));
       pm_strcpy(jcr->pool_source, _("Run NextPool override"));
-      source = _("Storage from Run NextPool override");
+      source = _("Run NextPool override");
    } else if (jcr->job->next_pool) {
       /* Use Job Next Pool */
       jcr->next_pool = jcr->job->next_pool;
       pm_strcpy(jcr->next_pool_source, _("Job's NextPool resource"));
       pm_strcpy(jcr->pool_source, _("Job's NextPool resource"));
-      source = _("Storage from Job's NextPool resource");
+      source = _("Job's NextPool resource");
    } else {
       /* Default to original pool->NextPool */
       jcr->next_pool = opool->NextPool;
@@ -961,7 +961,7 @@ bool apply_wstorage_overrides(JCR *jcr, POOL *opool)
       }
       pm_strcpy(jcr->next_pool_source, _("Job Pool's NextPool resource"));
       pm_strcpy(jcr->pool_source, _("Job Pool's NextPool resource"));
-      source = _("Storage from Pool's NextPool resource");
+      source = _("Pool's NextPool resource");
    }
 
    /*
@@ -1353,8 +1353,15 @@ void set_jcr_defaults(JCR *jcr, JOB *job)
    pm_strcpy(jcr->client_name, jcr->client->name());
    jcr->pool = job->pool;
    pm_strcpy(jcr->pool_source, _("Job resource"));
-   jcr->next_pool = job->pool->NextPool;
-   pm_strcpy(jcr->next_pool_source, _("Job's NextPool resource"));
+   if (job->next_pool) {
+      /* Use Job's Next Pool */
+      jcr->next_pool = job->next_pool;
+      pm_strcpy(jcr->next_pool_source, _("Job's NextPool resource"));
+   } else {
+      /* Default to original pool->NextPool */
+      jcr->next_pool = job->pool->NextPool;
+      pm_strcpy(jcr->next_pool_source, _("Job Pool's NextPool resource"));
+   }
    jcr->full_pool = job->full_pool;
    jcr->inc_pool = job->inc_pool;
    jcr->diff_pool = job->diff_pool;
index 4a31ac66d3be237c43f8872e57f76136a3032739..3ea04a8d9714565fc7beb79d4e46f07573e325e7 100644 (file)
@@ -269,7 +269,7 @@ static bool get_pool(UAContext *ua, run_ctx &rc)
 static bool get_next_pool(UAContext *ua, run_ctx &rc)
 {
    if (rc.next_pool_name) {
-      Dmsg1(100, "Have next pool override=%s\n", rc.next_pool_name);
+      Dmsg1(100, "Have next pool=%s\n", rc.next_pool_name);
       rc.next_pool = GetPoolResWithName(rc.next_pool_name);
       if (!rc.next_pool) {
          if (*rc.next_pool_name != 0) {
@@ -954,7 +954,7 @@ static bool set_run_context_in_jcr(UAContext *ua, JCR *jcr, run_ctx &rc)
    if (jcr->is_JobType(JT_MIGRATE) || jcr->is_JobType(JT_COPY) ||
       (jcr->is_JobType(JT_BACKUP) && jcr->is_JobLevel(L_VIRTUAL_FULL))) {
       if (!set_mac_wstorage(ua, jcr, rc.pool, rc.next_pool,
-            _("Storage from NextPool override"))) {
+            jcr->next_pool_source)) {
          return false;
       }
    }