Thanks, I missed that. Interdiff:
diff --git a/lib/jqueue/__init__.py b/lib/jqueue/__init__.py
index 0024754..e183846 100644
--- a/lib/jqueue/__init__.py
+++ b/lib/jqueue/__init__.py
@@ -566,9 +566,6 @@ class _QueuedJob(object):
@type pid: int
@param pid: the process ID
- @rtype: tuple; (bool, string)
- @return: Boolean describing whether job's priority was successfully
changed
- and a text message
"""
status = self.CalcStatus()
On Thu, Apr 17, 2014 at 4:46 PM, Klaus Aehlig <[email protected]> wrote:
> On Thu, Apr 17, 2014 at 03:11:37PM +0200, Petr Pudlak wrote:
> > The ID of the current process is stored in the job file.
> >
> > Signed-off-by: Petr Pudlak <[email protected]>
> > ---
> > lib/jqueue/__init__.py | 24 ++++++++++++++++++++++++
> > 1 file changed, 24 insertions(+)
> >
> > diff --git a/lib/jqueue/__init__.py b/lib/jqueue/__init__.py
> > index c29f3d8..4d6aff3 100644
> > --- a/lib/jqueue/__init__.py
> > +++ b/lib/jqueue/__init__.py
> > @@ -36,6 +36,7 @@ import weakref
> > import threading
> > import itertools
> > import operator
> > +import os
> >
> > try:
> > # pylint: disable=E0611
> > @@ -560,6 +561,27 @@ class _QueuedJob(object):
> > else:
> > return (False, "Job %s had no pending opcodes" % self.id)
> >
> > + def SetPid(self, pid):
> > + """Sets the job's process ID
> > +
> > + @type pid: int
> > + @param pid: the process ID
> > + @rtype: tuple; (bool, string)
> > + @return: Boolean describing whether job's priority was successfully
> changed
> > + and a text message
>
> The description of the return type/value seems wrong.
> More like always returning nothing. Remove these entries?
>
> > +
> > + """
> > + status = self.CalcStatus()
> > +
> > + if status in (constants.JOB_STATUS_QUEUED,
> > + constants.JOB_STATUS_WAITING):
> > + if self.process_id is not None:
> > + logging.warning("Replacing the process id %s of job %s with %s",
> > + self.process_id, self.id, pid)
> > + self.process_id = pid
> > + else:
> > + logging.warning("Can set pid only for queued/waiting jobs")
> > +
>
> Rest LGTM.
>
> --
> Klaus Aehlig
> Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
> Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores
>