fixed type hinting circular import error
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4e1b2d7dd4
commit
8af5cbce58
@ -1,9 +1,14 @@
|
|||||||
from pathlib import Path
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from . import LXC
|
|
||||||
from ..utils import proxmox_utils
|
from ..utils import proxmox_utils
|
||||||
from ..utils.resources_utils import get_path
|
from ..utils.resources_utils import get_path
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from . import LXC
|
||||||
|
|
||||||
|
|
||||||
def run_script(lxc: LXC, step: dict):
|
def run_script(lxc: LXC, step: dict):
|
||||||
"""Method use to dispatch the script to the correct method depending on the type of script, being
|
"""Method use to dispatch the script to the correct method depending on the type of script, being
|
||||||
|
@ -1,9 +1,15 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from . import commands_utils, LXC
|
from . import commands_utils
|
||||||
from ..utils.resources_utils import get_path
|
from ..utils.resources_utils import get_path
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from . import LXC
|
||||||
|
|
||||||
|
|
||||||
def are_all_conditions_met(lxc: LXC):
|
def are_all_conditions_met(lxc: LXC):
|
||||||
"""
|
"""
|
||||||
|
@ -11,7 +11,7 @@ def run():
|
|||||||
|
|
||||||
# Go through each LXC file
|
# Go through each LXC file
|
||||||
for resource in resources:
|
for resource in resources:
|
||||||
if resource == "lxc":
|
if resource.name == "lxc":
|
||||||
# Read all files in the LXC directory
|
# Read all files in the LXC directory
|
||||||
lxc_folders = Path(project_path).joinpath("resources", "lxc").glob("*")
|
lxc_folders = Path(project_path).joinpath("resources", "lxc").glob("*")
|
||||||
for lxc_folder in lxc_folders:
|
for lxc_folder in lxc_folders:
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import pathlib
|
import pathlib
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .. import project_path
|
from .. import project_path
|
||||||
from ..lxc import LXC
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..lxc import LXC
|
||||||
|
|
||||||
|
|
||||||
def get_path(lxc: LXC, path: str):
|
def get_path(lxc: LXC, path: str):
|
||||||
@ -41,4 +46,4 @@ def get_path(lxc: LXC, path: str):
|
|||||||
else:
|
else:
|
||||||
# Use VM/LXC folder
|
# Use VM/LXC folder
|
||||||
lxc_id = lxc.get_id()
|
lxc_id = lxc.get_id()
|
||||||
return parent.joinpath("lxc", lxc_id, path)
|
return parent.joinpath("lxc", str(lxc_id), path)
|
||||||
|
Loading…
Reference in New Issue
Block a user