fixed incorrect path for resources
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mathieu Broillet 2023-06-12 22:06:44 +02:00
parent b66309326c
commit 9dcf370a07
Signed by: mathieu
GPG Key ID: A08E484FE95074C1

View File

@ -1,8 +1,15 @@
import os
from src.get_path_file import project_path
def get_path(lxc, path): def get_path(lxc, path):
parent = os.path.join(project_path / "resources")
if path.startswith("/global/"): if path.startswith("/global/"):
# Use global folder # Use global folder
return "resources/scripts" + path[len("/global/"):] return parent + "/scripts/" + path[len("/global/"):]
else: else:
# Use VM/LXC folder # Use VM/LXC folder
lxc_id = lxc.get_id() lxc_id = lxc.get_id()
return f"resources/lxc/{lxc_id}/{path}" return parent + f"/resources/lxc/{lxc_id}/{path}"