diff --git a/src/utils/resources_utils.py b/src/utils/resources_utils.py index d48aa87..e4085c4 100644 --- a/src/utils/resources_utils.py +++ b/src/utils/resources_utils.py @@ -1,8 +1,15 @@ +import os + +from src.get_path_file import project_path + + def get_path(lxc, path): + parent = os.path.join(project_path / "resources") + if path.startswith("/global/"): # Use global folder - return "resources/scripts" + path[len("/global/"):] + return parent + "/scripts/" + path[len("/global/"):] else: # Use VM/LXC folder lxc_id = lxc.get_id() - return f"resources/lxc/{lxc_id}/{path}" \ No newline at end of file + return parent + f"/resources/lxc/{lxc_id}/{path}"