Thanks for that, I've been running some more tests to no avail. Even tried writing to a text file for purposes of debugging but nothing is writing. It's almost as if the callback isn't functioning at all?
Initially it appears we didn't have python callbacks enabled on the supervisor. Now the .cb file only states...
executing callback: done-job-self - begin
executing callback: done-job-self - end
#!/bin/env python
import sys,os
sys.path.append('%s/api/python' % os.environ['QBDIR'])
import qb
scriptPath = r'C:\Test\dependencyTest.py'
job = {
'prototype': 'cmdrange',
'name': 'supervisor-side script execution callback test',
'groups' : 'workstations',
'package': {'cmdline': 'hostname'},
'agenda': [],
'callbacks': []
}
cb = {
'language': 'python',
'triggers': 'done-job-self',
'code': '''
import os,subprocess,sys
file = open("C:/Test/logfile.txt", "w")
file.write("script fired\n")
script = '%s'
if os.path.exists(script):
file.write("dependency path located\n")
file.close()
pid = subprocess.Popen(['python',script]).pid
'''
% (scriptPath)
}
# append the frame's callback to the job's callback list
job['callbacks'].append(cb)
submitted = qb.submit(job)
for job in submitted:
print 'submitted %(id)s: %(name)s' % job