summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py
diff options
context:
space:
mode:
authorERIMROB <robertas.rimkus@est.tech>2020-05-12 12:56:56 +0100
committerERIMROB <robertas.rimkus@est.tech>2020-06-05 10:11:06 +0100
commit2760519436f78975f16f26c412e842e34b28d624 (patch)
tree3fb616398002bd4525c10ff8b510bbf5ebadc26f /components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py
parent5ed9b7d3cad56c6438bca305b6d2931bd320352b (diff)
[PMSH] Replace own logging implementation with pylog
Signed-off-by: ERIMROB <robertas.rimkus@est.tech> Issue-ID: DCAEGEN2-2155 Change-Id: I670c4fff8029a73075b651c2afe6237c08cf907c
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py')
-rw-r--r--components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py b/components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py
index 4d4c5311..be67cae6 100644
--- a/components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py
+++ b/components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py
@@ -17,8 +17,8 @@
# ============LICENSE_END=====================================================
import mod.aai_client as aai
-import mod.pmsh_logging as logger
from mod.pmsh_utils import ConfigHandler
+from mod import logger
from mod.subscription import AdministrativeState
@@ -40,21 +40,22 @@ class SubscriptionHandler:
self.app.app_context().push()
config = ConfigHandler.get_pmsh_config()
new_administrative_state = config['policy']['subscription']['administrativeState']
-
try:
if self.administrative_state == new_administrative_state:
- logger.debug('Administrative State did not change in the Config')
+ logger.info('Administrative State did not change in the Config')
else:
+ logger.info(f'Administrative State has changed from {self.administrative_state} '
+ f'to {new_administrative_state}.')
self.current_sub, self.current_nfs = aai.get_pmsh_subscription_data(config)
self.administrative_state = new_administrative_state
self.current_sub.process_subscription(self.current_nfs, self.mr_pub, self.app_conf)
if new_administrative_state == AdministrativeState.UNLOCKED.value:
- logger.debug('Listening to AAI-EVENT topic in MR.')
+ logger.info('Listening to AAI-EVENT topic in MR.')
self.aai_event_thread.start()
else:
- logger.debug('Stop listening to AAI-EVENT topic in MR.')
+ logger.info('Stop listening to AAI-EVENT topic in MR.')
self.aai_event_thread.cancel()
except Exception as err:
- logger.debug(f'Error occurred during the activation/deactivation process {err}')
+ logger.error(f'Error occurred during the activation/deactivation process {err}')