aboutsummaryrefslogtreecommitdiffstats
path: root/src/python/netconf_change_listener_application.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/netconf_change_listener_application.py')
-rw-r--r--src/python/netconf_change_listener_application.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/python/netconf_change_listener_application.py b/src/python/netconf_change_listener_application.py
index 34b00b3..400ff3d 100644
--- a/src/python/netconf_change_listener_application.py
+++ b/src/python/netconf_change_listener_application.py
@@ -21,7 +21,6 @@ import asyncio
import sys
import logging
-from typing import Tuple
from netconf_server.netconf_app_configuration import NetconfAppConfiguration
@@ -33,7 +32,7 @@ from netconf_server.sysrepo_interface.sysrepo_client import SysrepoClient
logging.basicConfig(
handlers=[logging.StreamHandler(), logging.FileHandler("/logs/netconf_change_listener.log")],
- level=logging.DEBUG
+ level=logging.INFO
)
logger = logging.getLogger("netconf_change_listener")
@@ -43,9 +42,9 @@ def run_server_forever(session, connection, change_listener: NetconfChangeListen
asyncio.get_event_loop().run_forever()
-def create_change_listener(module_configuration_file_path: str) -> NetconfChangeListener:
- configuration = SysrepoConfigurationLoader.load_configuration(module_configuration_file_path)
- return NetconfChangeListenerFactory(configuration.models_to_subscribe_to).create()
+def create_change_listener(app_configuration: NetconfAppConfiguration) -> NetconfChangeListener:
+ configuration = SysrepoConfigurationLoader.load_configuration(app_configuration.module_configuration_file_path)
+ return NetconfChangeListenerFactory(configuration.models_to_subscribe_to, app_configuration).create()
if __name__ == "__main__":
@@ -54,7 +53,7 @@ if __name__ == "__main__":
if app_configuration:
logger.info("Netconf change listener application configuration: {}".format(app_configuration))
try:
- netconf_change_listener = create_change_listener(app_configuration.module_configuration_file_path)
+ netconf_change_listener = create_change_listener(app_configuration)
SysrepoClient().run_in_session(run_server_forever, netconf_change_listener)
except ConfigLoadingException:
logger.error("File to load configuration from file %s" % app_configuration.module_configuration_file_path)