On Wed, May 25, 2011 at 12:07:24PM +0200, Michael Hanselmann wrote:
> Am 25. Mai 2011 11:09 schrieb Iustin Pop <[email protected]>:
> > On Mon, May 23, 2011 at 02:50:14PM +0200, Michael Hanselmann wrote:
> >> --- a/lib/cli.py
> >> +++ b/lib/cli.py
> >> +  def AddJobId(self, name, status, job_id):
> >> +    """Adds a job ID to the internal queue.
> >> +
> >> +    """
> >> +    self.jobs.append((0, status, job_id, name))
> >
> > In what context will this be used?
> 
> For LU-generated jobs. Here's an example from the client code of
> “gnt-node migrate”:
> 
>   for (status, job_id) in result[constants.JOB_IDS_KEY]:
>     jex.AddJobId(None, status, job_id)
> 
> > And why are you using duplicate indices, do we simply not care?
> 
> The only place where they're used is for sorting the results. If
> “SubmitPending” and “QueueJob” were to be called multiple times, there
> can also be duplicate indices (the former uses enumerate() on the
> internal queue). Should I change JobExecutor, maybe in a separate
> patch, to use a counter for all job additions?

That sounds good, thanks!

iustin

Reply via email to