From: Ward Vandewege Date: Thu, 28 Jan 2021 22:30:55 +0000 (-0500) Subject: run_upload_packages.py should make sure the directory it tries to put a X-Git-Url: https://git.arvados.org/arvados-dev.git/commitdiff_plain/0d66112d0a33cbdce8b7bee3ca0897fdf7462ab1 run_upload_packages.py should make sure the directory it tries to put a timestamp file in exists. No issue # Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- diff --git a/jenkins/run_upload_packages.py b/jenkins/run_upload_packages.py index 0840f2f..8a31d2e 100755 --- a/jenkins/run_upload_packages.py +++ b/jenkins/run_upload_packages.py @@ -5,6 +5,7 @@ # SPDX-License-Identifier: AGPL-3.0 import argparse +import errno import functools import glob import locale @@ -50,6 +51,15 @@ def run_and_grep(cmd, read_output, *regexps, class TimestampFile: def __init__(self, path): self.path = path + # Make sure the dirname for `path` exists + p = os.path.dirname(path) + try: + os.makedirs(p) + except OSError as exc: + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: + raise self.start_time = time.time() def last_upload(self):