From 9dcf370a076a0a919a60ecf346ea67a4ce9757da Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Mon, 12 Jun 2023 22:06:44 +0200 Subject: [PATCH] fixed incorrect path for resources --- src/utils/resources_utils.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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}"