PipelineFX Forum
Qube! => Developer Customization => Topic started by: Toph on July 25, 2013, 11:39:47 PM
-
Having trouble submitting job tags in python api with qube 6.5
is it possible to fill these tags out through the python API?
here's some sample code
job = qb.Job()
job['name'] = 'job tag test'
job['prototype'] = 'cmdline'
job['package'] = {'cmdline' : 'dir L:\\' }
job['show'] = 'test_show'
job['shot'] = 'test_shot'
job['custom1'] = 'elite job dataz'
sub = qb.submit(job)
job = qb.jobinfo(id=sub[0]['id'])
print job[0].get('show')
this snippet of code returns None
same thing happened when i tried
job['prod_show'] = 'test_show'
-
Are you using a 6.5 version of both the supervisor and the python API as well?
>>> import qb
>>> qb.version()
'6.5-0'
>>> j = qb.jobinfo(id=41270)[0]
>>> j['prod_show']
'another show'
>>>
-
Looks like an error in our documentation tripped you up, our apologies. All the keys have a prod_ prefix:
import qb
job = qb.Job()
job['name'] = 'job tag test'
job['prototype'] = 'cmdline'
job['package'] = {'cmdline' : 'dir L:\\' }
job['prod_show'] = 'test_show'
job['prod_shot'] = 'test_shot'
job['prod_custom1'] = 'elite job dataz'
sub = qb.submit(job)[0]
print 'submitted %(id)s: %(name)s' % sub
job = qb.jobinfo(id=sub['id'])[0]
for n in ['show', 'shot', 'custom1']:
print '%s: %s' % (n, job.get('prod_%s' % n))
yields:
$> python tagTest.py
submitted 41287: job tag test
show: test_show
shot: test_shot
custom1: elite job dataz
I've fixed the offending piece in http://docs.pipelinefx.com/display/QUB065/Tags+and+the+Qube+API
-
i was in fact importing the wrong version of the API. After that and adding the prefix it works perfectly!