diff options
author | ERIMROB <robertas.rimkus@est.tech> | 2020-06-19 13:09:44 +0100 |
---|---|---|
committer | ERIMROB <robertas.rimkus@est.tech> | 2020-06-30 02:15:21 +0100 |
commit | b80449b81a2deb3b6e2510a655de02f9375ef636 (patch) | |
tree | ee022a88ee287645c72f6716eb9c501b9cf06484 /components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py | |
parent | 20637908b156aeff53d7607f88d655d0becc1f11 (diff) |
[PMSH] Improve Failure Handling
Signed-off-by: ERIMROB <robertas.rimkus@est.tech>
Change-Id: I15d338321957a293e9f444a10cf3bb06f4212f3e
Issue-ID: DCAEGEN2-2157
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py')
-rw-r--r-- | components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py b/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py index 2b917cec..8a993828 100644 --- a/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py +++ b/components/pm-subscription-handler/pmsh_service/mod/policy_response_handler.py @@ -18,8 +18,6 @@ import json -from tenacity import retry, wait_fixed, retry_if_exception_type - from mod import logger from mod.network_function import NetworkFunction from mod.subscription import Subscription, AdministrativeState, subscription_nf_states @@ -42,7 +40,6 @@ class PolicyResponseHandler: self.app_conf = app_conf self.app = app - @retry(wait=wait_fixed(5), retry=retry_if_exception_type(Exception)) def poll_policy_topic(self): """ This method polls MR for response from policy. It checks whether the message is for the @@ -62,7 +59,7 @@ class PolicyResponseHandler: self._handle_response(self.app_conf.subscription.subscriptionName, administrative_state, nf_name, response_message) except Exception as err: - raise Exception(f'Error trying to poll policy response topic on MR: {err}') + logger.error(f'Error trying to poll policy response topic on MR: {err}') @staticmethod def _handle_response(subscription_name, administrative_state, nf_name, response_message): @@ -82,4 +79,5 @@ class PolicyResponseHandler: policy_response_handle_functions[administrative_state][response_message]( subscription_name=subscription_name, status=sub_nf_status, nf_name=nf_name) except Exception as err: - raise Exception(f'Error changing nf_sub status in the DB: {err}') + logger.error(f'Error changing nf_sub status in the DB: {err}') + raise |