Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions automation/script/module_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,9 @@ def doc(i):


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update_path_for_docker(path, mounts, force_path_target=''):
# This function takes in a host path and returns the absolute path on host and the container
# If mounts is passed, the function appends the host path and the container path to mounts in the form "host_path:container_path"
def update_path_for_docker(path, mounts=None, force_path_target=''):

path_orig = ''
path_target = ''
Expand Down Expand Up @@ -1114,14 +1116,14 @@ def update_path_for_docker(path, mounts, force_path_target=''):
x = path_orig + ':' + path_target

# CHeck if no duplicates
to_add = True
for y in mounts:
if y.lower()==x.lower():
to_add = False
break

if to_add:
mounts.append(x)
if mounts != None:
to_add = True
for y in mounts:
if y.lower()==x.lower():
to_add = False
break
if to_add:
mounts.append(x)


return (path_orig, path_target)
Expand Down Expand Up @@ -1617,8 +1619,11 @@ def get_container_path(value):
new_path_split1 = new_path_split + path_split[repo_entry_index:repo_entry_index+3]
new_path_split2 = new_path_split + path_split[repo_entry_index:]
return "/".join(new_path_split1), "/".join(new_path_split2)
else:
orig_path,target_path = update_path_for_docker(path=value)
return target_path, target_path

return value, value
# return value, value


############################################################
Expand Down