]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/pythondir.c
- Tweak catalog make scripts.
[bacula/bacula] / bacula / src / dird / pythondir.c
index 9f5df846c0326d169be6012fbc2ac04da3cde8ef..d64bb23e3da7dd5780eba9c754eb6af3cca88c1c 100644 (file)
@@ -140,13 +140,25 @@ PyObject *job_getattr(PyObject *self, char *attrname)
          goto bail_out;
       }
    case 6:                            /* Pool */
-      return Py_BuildValue(getvars[i].fmt, jcr->pool->hdr.name);
+      return Py_BuildValue(getvars[i].fmt, jcr->pool->name());
    case 7:                            /* Storage */
-      return Py_BuildValue(getvars[i].fmt, jcr->store->hdr.name);
+      if (jcr->wstore) {
+         return Py_BuildValue(getvars[i].fmt, jcr->wstore->name());
+      } else if (jcr->rstore) {
+         return Py_BuildValue(getvars[i].fmt, jcr->rstore->name());
+      } else {
+         goto bail_out;
+      }
    case 8:
-      return Py_BuildValue(getvars[i].fmt, jcr->catalog->hdr.name);
+      return Py_BuildValue(getvars[i].fmt, jcr->catalog->name());
    case  9:                           /* MediaType */
-      return Py_BuildValue(getvars[i].fmt, jcr->store->media_type);
+      if (jcr->wstore) {
+         return Py_BuildValue(getvars[i].fmt, jcr->wstore->media_type);
+      } else if (jcr->rstore) {
+         return Py_BuildValue(getvars[i].fmt, jcr->rstore->media_type);
+      } else {
+         goto bail_out;
+      }
    case 10:                           /* JobName */
       return Py_BuildValue(getvars[i].fmt, jcr->Job);
    case 11:                           /* JobStatus */