Skip to content

Commit

Permalink
Dry run support
Browse files Browse the repository at this point in the history
  • Loading branch information
maouw committed Sep 20, 2023
1 parent 5b7282f commit 1a85d58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hyakvnc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ def cmd_create(container_path, dry_run=False):

# Launch sbatch process:
logging.info("Launching sbatch process with command:\n" + " ".join(cmds))

if dry_run:
print(f"Woud have run: {' '.join(cmds)}")
return

res = subprocess.run(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if res.returncode != 0:
raise RuntimeError(f"Could not launch sbatch job:\n{res.stderr}")
Expand Down

0 comments on commit 1a85d58

Please sign in to comment.