included librouteros library to avoid conflicts with other integrations #2

This commit is contained in:
tomaae 2019-12-08 08:57:10 +01:00
parent c58184b0f7
commit b70bb9db92
9 changed files with 590 additions and 4 deletions

View file

@ -2,8 +2,18 @@
import ssl
import logging
import librouteros
import os
import sys
import importlib
from .exceptions import OldLibrouteros, ApiEntryNotFound
MODULE_PATH = os.path.join(os.path.dirname(__file__), "librouteros", "__init__.py")
MODULE_NAME = "librouteros"
spec = importlib.util.spec_from_file_location(MODULE_NAME, MODULE_PATH)
librouteros = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = librouteros
spec.loader.exec_module(librouteros)
_LOGGER = logging.getLogger(__name__)