1
0
Fork 0
Dieser Commit ist enthalten in:
Sebastian Tobie 2023-04-15 19:02:20 +02:00
Ursprung ebca030585
Commit e2fdd94da4
4 geänderte Dateien mit 13 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -7,10 +7,11 @@ try:
from ansible.module_utils.generic import Types
from ansible.module_utils.module import SystemdUnitModule
except ImportError:
from generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
from generic import Types
from module import SystemdUnitModule
import sys
print(sys.path)
from module_utils.generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
from module_utils.generic import Types
from module_utils.module import SystemdUnitModule
class Module(SystemdUnitModule):
"""generates an systemd-networkd link"""

Datei anzeigen

@ -1,15 +1,13 @@
#!/usr/bin/python3
import pathlib
from typing import List, Optional
try:
from ansible.module_utils.generic import SYSTEMD_SERVICE_CONFIG as SYSTEMD_PATH
from ansible.module_utils.generic import Types
from ansible.module_utils.module import SystemdUnitModule
except ImportError:
from generic import SYSTEMD_SERVICE_CONFIG as SYSTEMD_PATH
from generic import Types
from module import SystemdUnitModule
import sys
print(sys.path)
SYSTEMD_PATH = pathlib.Path("/etc/systemd/system")

Datei anzeigen

@ -7,9 +7,8 @@ try:
from ansible.module_utils.generic import Types
from ansible.module_utils.module import SystemdUnitModule
except ImportError:
from generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
from generic import Types
from module import SystemdUnitModule
import sys
print(sys.path)
def boolconvert(b: Union[bool, str]) -> str:
if b is True:

Datei anzeigen

@ -3,10 +3,11 @@ import re
import pathlib
import importlib
import sys
import ansible.module_utils
sys.path.append("plugins/module_utils")
sys.path.append("plugins/modules")
mindocstring = "DOCUMENTATION = ''''''"
sys.path.append("plugins/modules")
sys.path.append(".")
moduledir = pathlib.Path("plugins/modules")
regex = re.compile("DOCUMENTATION *= *r?(?P<quote>\"{3}|'{3})(---)?.*?(?P=quote)", re.MULTILINE | re.DOTALL)
@ -15,7 +16,7 @@ if __name__ == "__main__":
for modfile in moduledir.iterdir():
if modfile.name in ( "__init__.py", "__pycache__"):
continue
mod = importlib.import_module(modfile.stem)
mod = importlib.import_module("plugins.modules."+modfile.stem)
if hasattr(mod, "Module"):
module = mod.Module
elif hasattr(mod, "__module_name__"):