Skip to content

Commit 309919e

Browse files
committed
retain as much of the dockerPull/imageId as possible
1 parent a3c4482 commit 309919e

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

cwltool/singularity.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,10 @@ def _singularity_supports_userns(): # type: ()->bool
5454
return _USERNS
5555

5656
def _normalize_image_id(string): # type: (Text)->Text
57-
candidate = re.sub(pattern=r'([a-z]*://)', repl=r'', string=string)
58-
return re.sub(pattern=r'[:/]', repl=r'-', string=candidate) + ".img"
57+
return string.replace('/', '_') + '.img'
5958

6059
def _normalize_sif_id(string): # type: (Text)->Text
61-
candidate = re.sub(pattern=r'([a-z]*://)', repl=r'', string=string)
62-
candidate_new = re.sub(pattern=r'[::]', repl=r'_', string=candidate) + ".sif"
63-
if '/' in candidate_new:
64-
return candidate_new.split('/')[1]
65-
else:
66-
return candidate_new
60+
return string.replace('/', '_') + '.sif'
6761

6862
class SingularityCommandLineJob(ContainerCommandLineJob):
6963

tests/test_udocker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_udocker_usage_should_not_write_cid_file(self, tmpdir):
5151

5252
tmpdir.remove(ignore_errors=True)
5353

54-
assert "completed success" in stderr
54+
assert "completed success" in stderr, stderr
5555
assert cidfiles_count == 0
5656

5757
@pytest.mark.skipif(TRAVIS, reason='Not reliable on single threaded test on travis.')
@@ -63,5 +63,5 @@ def test_udocker_should_display_memory_usage(self, tmpdir):
6363
cwd.chdir()
6464
tmpdir.remove(ignore_errors=True)
6565

66-
assert "completed success" in stderr
67-
assert "Max memory" in stderr
66+
assert "completed success" in stderr, stderr
67+
assert "Max memory" in stderr, stderr

0 commit comments

Comments
 (0)