I have a rundeck job that iterates on a variable list. Each iteration executes a parameterized rundeck job (different params each time). I decided to use the run command (I suppose it would be better to use the web api).
The run command is apparently asynchronous as I was getting an error showing that the forked job is already running (the previous apparently hadn't completed yet)
executing promote job for rundeckJobId: zap/promoteZapBuild |
| 12:42:23 | ERROR RundeckCentralDispatcher: Job "promoteZapBuild" [21] is currently being executed (execution [293]) |
| 12:42:23 | ERROR RundeckCentralDispatcher: Server reported an error: Job "promoteZapBuild" [21] is currently being executed (execution [293]) |
| 12:42:23 | Error: Failed request to run a job: Job "promoteZapBuild" [21] is currently being executed (execution [293]) |
| 12:42:23 | error runnbuild zap/promoteZapBuild for build: zap-httpd-config |
To verify that it is asynchronous, I injected a sleep to verify that it is indeed asynchronous.
def runRundeckJob(rundeckJobId, build):
print "executing promote job for build: " + build
#return subprocess.call(["run", "-j", rundeckJobId, "--", "-archiveFile", "archive.zip", "-build", build, "-ciHost", "
dev-ctier1.acme.com:8180", "-yumDir", "/data/yum/zap-repo", "createRepo", "false"])
status=subprocess.call(["run", "-j", rundeckJobId, "--", "-archiveFile", "archive.zip", "-build", build, "-ciHost", "
dev-ctier1.acme.com:8180", "-yumDir", "/data/yum/zap-repo", "createRepo", "false"])
if status == 0:
time.sleep(10)
return 0
else:
return status
Is it possible to execute a job synchronously w/o being overly clever?