diff options
author | emartin <ephraim.martin@est.tech> | 2020-03-25 10:05:35 +0000 |
---|---|---|
committer | emartin <ephraim.martin@est.tech> | 2020-03-25 11:38:36 +0000 |
commit | 03e058dbd9e298eda2ce4fcb3a5babaf08434cf5 (patch) | |
tree | b3ba5a1251f50cdd369ad22439b8745e0aa6c182 /components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py | |
parent | 8bfed3e53e55f711b1eb7d9cca696b3519658842 (diff) |
Handle graceful exit of PMSH1.0.2
Issue-ID: DCAEGEN2-1832
Change-Id: If0362e1927f7013d25f0cf23ade5ce9d2bdea8e3
Signed-off-by: emartin <ephraim.martin@est.tech>
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.py | 12 |
1 files changed, 7 insertions, 5 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 a615aa77..40b8c962 100644 --- a/components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py +++ b/components/pm-subscription-handler/pmsh_service/mod/subscription_handler.py @@ -22,14 +22,16 @@ from mod.subscription import AdministrativeState class SubscriptionHandler: - def __init__(self, config_handler, administrative_state, mr_pub, - aai_event_thread, app, app_conf): + def __init__(self, config_handler, administrative_state, mr_pub, app, app_conf, + aai_event_thread): + self.current_nfs = None + self.current_sub = None self.config_handler = config_handler self.administrative_state = administrative_state self.mr_pub = mr_pub - self.aai_event_thread = aai_event_thread self.app = app self.app_conf = app_conf + self.aai_event_thread = aai_event_thread def execute(self): """ @@ -44,9 +46,9 @@ class SubscriptionHandler: if self.administrative_state == new_administrative_state: logger.debug('Administrative State did not change in the Config') else: - sub, network_functions = aai.get_pmsh_subscription_data(config) + self.current_sub, self.current_nfs = aai.get_pmsh_subscription_data(config) self.administrative_state = new_administrative_state - sub.process_subscription(network_functions, self.mr_pub, self.app_conf) + 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.') |