*
*/
/*
- Copyright (C) 2004-2005 Kern Sibbald
+ Copyright (C) 2004-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
/* Read-only variables */
static struct s_vars getvars[] = {
- { N_("Job"), "s"},
- { N_("Level"), "s"},
- { N_("Type"), "s"},
- { N_("JobId"), "i"},
- { N_("Client"), "s"},
- { N_("NumVols"), "i"},
- { N_("Pool"), "s"},
- { N_("Storage"), "s"},
- { N_("Catalog"), "s"},
- { N_("MediaType"), "s"},
- { N_("JobName"), "s"},
- { N_("JobStatus"), "s"},
- { N_("Priority"), "i"},
- { N_("CatalogRes"), "(sssssis)"},
+ { "Job", "s"},
+ { "Level", "s"},
+ { "Type", "s"},
+ { "JobId", "i"},
+ { "Client", "s"},
+ { "NumVols", "i"},
+ { "Pool", "s"},
+ { "Storage", "s"},
+ { "Catalog", "s"},
+ { "MediaType", "s"},
+ { "JobName", "s"},
+ { "JobStatus", "s"},
+ { "Priority", "i"},
+ { "VolumeName", "s"},
+ { "CatalogRes", "(sssssis)"},
{ NULL, NULL}
};
/* Writable variables */
static struct s_vars setvars[] = {
- { N_("JobReport"), "s"},
- { N_("VolumeName"), "s"},
- { N_("Priority"), "i"},
+ { "JobReport", "s"},
+ { "VolumeName", "s"},
+ { "Priority", "i"},
{ NULL, NULL}
};
return Py_BuildValue(getvars[i].fmt, buf);
case 12: /* Priority */
return Py_BuildValue(getvars[i].fmt, jcr->JobPriority);
- case 13: /* CatalogRes */
+ case 13:
+ return Py_BuildValue(getvars[i].fmt, jcr->VolumeName);
+ case 14: /* CatalogRes */
return Py_BuildValue(getvars[i].fmt,
jcr->catalog->db_name, jcr->catalog->db_address,
jcr->catalog->db_user, jcr->catalog->db_password,
return -1;
}
-
+/*
+ * Set pointer to instantiated events class
+ */
static PyObject *set_job_events(PyObject *self, PyObject *arg)
{
PyObject *eObject;
return Py_None;
}
-/* Run a Bacula command */
+/* Run a Bacula job */
static PyObject *job_run(PyObject *self, PyObject *arg)
{
JCR *jcr;
}
foreach_jcr(jcr) {
if (jcr->JobId == 0) {
- free_jcr(jcr);
continue;
}
if (jcr->JobId == JobId) {
break;
}
}
+ /* endeach_jcr(jcr) not needed because freed below */
+
if (!found) {
/* ***FIXME*** raise exception */
return NULL;