Fixed UnboundLocalError
There was an UnboundLocalError in one of the jobs: https://gitlab.esss.lu.se/ccce/ans/ics-ans-role-lab-ioc-deploy/-/jobs/228766
# Kill procServ
with host.sudo():
host.run(f"kill {pid}")
# Check that kill was successful
try:
host.process.get(pid=pid)
except RuntimeError as e:
msg = str(e)
> assert msg == "No process found"
E UnboundLocalError: local variable 'msg' referenced before assignment
Fixed that by adding a sleep between killing and checking the result and by initializing msg