Skip to content

Commit

Permalink
Replace use of procrunner with subprocess (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjgildea authored Jun 15, 2023
1 parent 9c153de commit ad44b0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ History

Unreleased / main
-------------------
* Replace use of ``procrunner`` with ``subprocess``

8.0.1 (2023-06-07)
-------------------
Expand Down
9 changes: 5 additions & 4 deletions src/ispyb/cli/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import os
import re
import shutil
import subprocess
import sys
from optparse import SUPPRESS_HELP, OptionGroup, OptionParser

Expand All @@ -38,7 +40,6 @@
)

try:
import procrunner
import zocalo.configuration
except ModuleNotFoundError:
zocalo = None
Expand Down Expand Up @@ -140,11 +141,11 @@ def create_processing_job(i, db_session, options):
print()
if zocalo:
if options.trigger:
go_call = ["zocalo.go", "-p", str(jobid)]
go_call = [shutil.which("zocalo.go"), "-p", str(jobid)]
for kv in trigger_variables:
go_call.append("--set=%s=%s" % (kv[0], kv[1]))
result = procrunner.run(go_call)
if result["exitcode"] or result["stderr"]:
result = subprocess.run(go_call, capture_output=True)
if result.returncode or result.stderr:
sys.exit("Error triggering processing job")
print("Successfully triggered processing job")
else:
Expand Down

0 comments on commit ad44b0a

Please sign in to comment.