Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated logic for mounting non cache folder #427

Merged
merged 2 commits into from
Oct 28, 2024
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
Loading