Skip to content

Commit

Permalink
robustness checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bailey authored and Stephen Bailey committed Aug 27, 2024
1 parent a8b0479 commit 61c000e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bin/desi_use_reservation
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ def use_reservation(name=None, resinfo=None, extra_nodes=0, dry_run=False):

log = get_logger()

if resinfo is None and name is None:
msg = 'Must provide either name or resinfo'
log.critical(msg)
raise ValueError(msg)

if resinfo is None:
resinfo = get_reservation_info(name)

Expand Down Expand Up @@ -180,7 +185,11 @@ def use_reservation(name=None, resinfo=None, extra_nodes=0, dry_run=False):
print(cmd)
else:
log.info(cmd)
subprocess.run(cmd.split())
try:
subprocess.run(cmd.split(), check=True)
except subprocess.CalledProcessError as err:
log.error(str(err))
log.warning('Continuing anyway')

#--------------------------------------------------------------------

Expand Down

0 comments on commit 61c000e

Please sign in to comment.