X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1d77dec0f7bc1cca34d52288bd39ecd0a79be250..98c6c6990061c546b9995ad70766589499fb4844:/sdk/python/arvados/commands/run.py diff --git a/sdk/python/arvados/commands/run.py b/sdk/python/arvados/commands/run.py index 216b512085..831e496a29 100644 --- a/sdk/python/arvados/commands/run.py +++ b/sdk/python/arvados/commands/run.py @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + from __future__ import print_function from __future__ import absolute_import from builtins import range @@ -108,7 +112,7 @@ def determine_project(root, current_user): # ArvFile() (file already exists in a collection), UploadFile() (file needs to # be uploaded to a collection), or simply returns prefix+fn (which yields the # original parameter string). -def statfile(prefix, fn, fnPattern="$(file %s/%s)", dirPattern="$(dir %s/%s/)"): +def statfile(prefix, fn, fnPattern="$(file %s/%s)", dirPattern="$(dir %s/%s/)", raiseOSError=False): absfn = os.path.abspath(fn) try: st = os.stat(absfn) @@ -125,7 +129,7 @@ def statfile(prefix, fn, fnPattern="$(file %s/%s)", dirPattern="$(dir %s/%s/)"): # trim leading '/' for path prefix test later return UploadFile(prefix, absfn[1:]) except OSError as e: - if e.errno == errno.ENOENT: + if e.errno == errno.ENOENT and not raiseOSError: pass else: raise