Author Topic: cannot get the jobID#  (Read 10947 times)

bijuramavfx

  • Sr. Member
  • ****
  • Posts: 40
cannot get the jobID#
« on: November 05, 2012, 08:07:32 PM »
Hi there:

Here is the code that I am trying to run andI am not getting the JobID after the submission

        qubeJob = qb.Job()
        qubeJob['name'] = job.sceneName
        qubeJob['prototype'] = 'cmdrange'
        qubeJob['package'] = {'cmdline' : jobCommandLine,
                              'range'   :   job.frames,
                              'frameCount'  : 5,
                              'renderNode'  : 'Render',
                              'script'      : job.scene,
                              }
        qubeJob['agenda'] = qb.genframes(qubeJob['package']['range'])
        jobId = qb.submit(qubeJob)
        print jobId

I get None ..?

Thanks and much appreciated

/Biju

jburk

  • Administrator
  • *****
  • Posts: 493
Re: cannot get the jobID#
« Reply #1 on: November 05, 2012, 08:52:36 PM »
qb.submit() returns a list, so you should do one of these two approaches:

Code: [Select]
jobId = qb.submit(qubeJob)[0]
    print jobId
or
Code: [Select]
for j in qb.submit(job):
    print '%(name)s: %(id)s' % j

I always use the 2nd form, it also covers the case if I change the script to submit multiple jobs; you just pass the list of jobs to qb.submit like this:
Code: [Select]
for j in qb.submit([jobA, jobB, jobC]):
    print '%(name)s: %(id)s' % j

bijuramavfx

  • Sr. Member
  • ****
  • Posts: 40
Re: cannot get the jobID#
« Reply #2 on: November 05, 2012, 09:12:16 PM »
thanks jburk like always it works.. :-)