removed all try except
Dieser Commit ist enthalten in:
Ursprung
e2fdd94da4
Commit
491270a022
|
@ -2,10 +2,7 @@ import pathlib
|
||||||
from typing import Any, Callable, ClassVar, Dict, Optional, TypeVar, NoReturn, overload
|
from typing import Any, Callable, ClassVar, Dict, Optional, TypeVar, NoReturn, overload
|
||||||
|
|
||||||
import ansible.module_utils.basic as basic
|
import ansible.module_utils.basic as basic
|
||||||
try:
|
|
||||||
from ansible.module_utils.generic import _sdict
|
from ansible.module_utils.generic import _sdict
|
||||||
except ImportError:
|
|
||||||
from generic import _sdict
|
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
"AnsibleModule",
|
"AnsibleModule",
|
||||||
|
|
|
@ -2,16 +2,9 @@
|
||||||
import pathlib
|
import pathlib
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
try:
|
|
||||||
from ansible.module_utils.generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
|
from ansible.module_utils.generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
|
||||||
from ansible.module_utils.generic import Types
|
from ansible.module_utils.generic import Types
|
||||||
from ansible.module_utils.module import SystemdUnitModule
|
from ansible.module_utils.module import SystemdUnitModule
|
||||||
except ImportError:
|
|
||||||
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):
|
class Module(SystemdUnitModule):
|
||||||
"""generates an systemd-networkd link"""
|
"""generates an systemd-networkd link"""
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
import pathlib
|
import pathlib
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
try:
|
|
||||||
from ansible.module_utils.generic import SYSTEMD_SERVICE_CONFIG as SYSTEMD_PATH
|
from ansible.module_utils.generic import SYSTEMD_SERVICE_CONFIG as SYSTEMD_PATH
|
||||||
from ansible.module_utils.generic import Types
|
from ansible.module_utils.generic import Types
|
||||||
from ansible.module_utils.module import SystemdUnitModule
|
from ansible.module_utils.module import SystemdUnitModule
|
||||||
except ImportError:
|
|
||||||
import sys
|
|
||||||
print(sys.path)
|
|
||||||
|
|
||||||
SYSTEMD_PATH = pathlib.Path("/etc/systemd/system")
|
SYSTEMD_PATH = pathlib.Path("/etc/systemd/system")
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,9 @@
|
||||||
import pathlib
|
import pathlib
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
try:
|
|
||||||
from ansible.module_utils.generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
|
from ansible.module_utils.generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
|
||||||
from ansible.module_utils.generic import Types
|
from ansible.module_utils.generic import Types
|
||||||
from ansible.module_utils.module import SystemdUnitModule
|
from ansible.module_utils.module import SystemdUnitModule
|
||||||
except ImportError:
|
|
||||||
import sys
|
|
||||||
print(sys.path)
|
|
||||||
|
|
||||||
def boolconvert(b: Union[bool, str]) -> str:
|
def boolconvert(b: Union[bool, str]) -> str:
|
||||||
if b is True:
|
if b is True:
|
||||||
|
|
Laden…
In neuem Issue referenzieren