[ARVADOS] updated: 932a318673b17b63a2f2d99a6ba170c908ef3b20

Git user git at public.curoverse.com
Thu May 25 21:39:35 EDT 2017


Summary of changes:
 sdk/cwl/tests/test_pathmapper.py   | 4 ++--
 sdk/python/arvados/commands/run.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

       via  932a318673b17b63a2f2d99a6ba170c908ef3b20 (commit)
       via  e578f043c4d3b45a08f15d365adea0386228a4bf (commit)
      from  1d77dec0f7bc1cca34d52288bd39ecd0a79be250 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 932a318673b17b63a2f2d99a6ba170c908ef3b20
Merge: 1d77dec e578f04
Author: Jiayong Li <jiayong at math.mit.edu>
Date:   Thu May 25 21:38:12 2017 -0400

    refs #11362 Merge branch '11362-missing-input-sdk/python'


commit e578f043c4d3b45a08f15d365adea0386228a4bf
Author: Jiayong Li <jiayong at math.mit.edu>
Date:   Thu May 25 21:36:51 2017 -0400

    Change statfile in run.py to be able to raise OSError, and change the mock in test_pathmapper.py accordingly

diff --git a/sdk/cwl/tests/test_pathmapper.py b/sdk/cwl/tests/test_pathmapper.py
index 3e7918a..7ba9649 100644
--- a/sdk/cwl/tests/test_pathmapper.py
+++ b/sdk/cwl/tests/test_pathmapper.py
@@ -47,7 +47,7 @@ class TestPathmap(unittest.TestCase):
 
         arvrunner = arvados_cwl.ArvCwlRunner(self.api)
 
-        def statfile_mock(prefix, fn, fnPattern="$(file %s/%s)", dirPattern="$(dir %s/%s/)"):
+        def statfile_mock(prefix, fn, fnPattern="$(file %s/%s)", dirPattern="$(dir %s/%s/)", raiseOSError=False):
             st = arvados.commands.run.UploadFile("", "tests/hw.py")
             return st
 
@@ -87,7 +87,7 @@ class TestPathmap(unittest.TestCase):
 
         # An ArvFile object returned from arvados.commands.run.statfile means the file is located on a
         # keep mount, so we can construct a direct reference directly without upload.
-        def statfile_mock(prefix, fn, fnPattern="$(file %s/%s)", dirPattern="$(dir %s/%s/)"):
+        def statfile_mock(prefix, fn, fnPattern="$(file %s/%s)", dirPattern="$(dir %s/%s/)", raiseOSError=False):
             st = arvados.commands.run.ArvFile("", fnPattern % ("99999999999999999999999999999991+99", "hw.py"))
             return st
 
diff --git a/sdk/python/arvados/commands/run.py b/sdk/python/arvados/commands/run.py
index 216b512..6e02005 100644
--- a/sdk/python/arvados/commands/run.py
+++ b/sdk/python/arvados/commands/run.py
@@ -108,7 +108,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 +125,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

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list