From cae4c93dcc3fb478546747a725ea00aeeb7aa114 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 12 Sep 2006 19:21:09 +0000 Subject: [PATCH] kes Add JobErrors, JobFiles, SDJobFiles, SDJobErrors, SDJobStatus, and FDJobStatus to the Director Python variables. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3460 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 8 ++++++++ bacula/src/dird/pythondir.c | 23 ++++++++++++++++++++++- bacula/technotes-1.39 | 2 ++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 09954f15ac..5e37d3c365 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -29,6 +29,14 @@ Document: building the French PDF. - Document more DVD stuff -- particularly that recycling doesn't work, and all the other things too. +- Doc + { "JobErrors", "i"}, + { "JobFiles", "i"}, + { "SDJobFiles", "i"}, + { "SDErrors", "i"}, + { "FDJobStatus","s"}, + { "SDJobStatus","s"}, + Priority: diff --git a/bacula/src/dird/pythondir.c b/bacula/src/dird/pythondir.c index 09c49659f8..a4138f2b4a 100644 --- a/bacula/src/dird/pythondir.c +++ b/bacula/src/dird/pythondir.c @@ -74,6 +74,12 @@ static struct s_vars getvars[] = { { "Priority", "i"}, { "VolumeName", "s"}, { "CatalogRes", "(sssssis)"}, + { "JobErrors", "i"}, + { "JobFiles", "i"}, + { "SDJobFiles", "i"}, + { "SDErrors", "i"}, + { "FDJobStatus","s"}, + { "SDJobStatus","s"}, { NULL, NULL} }; @@ -175,7 +181,22 @@ PyObject *job_getattr(PyObject *self, char *attrname) jcr->catalog->db_user, jcr->catalog->db_password, jcr->catalog->db_socket, jcr->catalog->db_port, db_get_type()); - + case 15: /* JobErrors */ + return Py_BuildValue(getvars[i].fmt, jcr->JobErrors); + case 16: /* JobFiles */ + return Py_BuildValue(getvars[i].fmt, jcr->JobFiles); + case 17: /* SDJobFiles */ + return Py_BuildValue(getvars[i].fmt, jcr->SDJobFiles); + case 18: /* SDErrors */ + return Py_BuildValue(getvars[i].fmt, jcr->SDErrors); + case 19: /* FDJobStatus */ + buf[1] = 0; + buf[0] = jcr->FDJobStatus; + return Py_BuildValue(getvars[i].fmt, buf); + case 29: /* SDJobStatus */ + buf[1] = 0; + buf[0] = jcr->SDJobStatus; + return Py_BuildValue(getvars[i].fmt, buf); } bsnprintf(errmsg, sizeof(errmsg), _("Attribute %s not found."), attrname); bail_out: diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 2c334df639..95499379b4 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -2,6 +2,8 @@ General: 12Sep06 +kes Add JobErrors, JobFiles, SDJobFiles, SDJobErrors, SDJobStatus, + and FDJobStatus to the Director Python variables. kes Make sure valid argument passed to str_to_utime() where Arno had a seg fault. kes Apply Richard Mortimer's patch for bcopy, bextract, and bscan. -- 2.39.5