summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/pmsh_service/mod/aai_event_handler.py
diff options
context:
space:
mode:
authoremartin <ephraim.martin@est.tech>2020-02-27 13:56:52 +0000
committeremartin <ephraim.martin@est.tech>2020-02-28 11:24:53 +0000
commitc19a0a85bbbc8dcf0633a32d26f4128f6c8c4544 (patch)
tree234c14ca8729b852f0ea229483807890b8f96362 /components/pm-subscription-handler/pmsh_service/mod/aai_event_handler.py
parent82a39f7da3177a9b9b700c7291ed5ea47c90e478 (diff)
Update PM subscription event for PMSH
* Add control loop name * Remove invariant id reference Issue-ID: DCAEGEN2-2100 Signed-off-by: emartin <ephraim.martin@est.tech> Change-Id: I6bbb757e07f3d930ecd28bd3106df307a264ff65
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod/aai_event_handler.py')
-rwxr-xr-xcomponents/pm-subscription-handler/pmsh_service/mod/aai_event_handler.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/aai_event_handler.py b/components/pm-subscription-handler/pmsh_service/mod/aai_event_handler.py
index f8254e52..9d69e760 100755
--- a/components/pm-subscription-handler/pmsh_service/mod/aai_event_handler.py
+++ b/components/pm-subscription-handler/pmsh_service/mod/aai_event_handler.py
@@ -39,7 +39,7 @@ class OrchestrationStatus(Enum):
INVENTORIED = 'Inventoried'
-def process_aai_events(mr_sub, subscription, mr_pub, app):
+def process_aai_events(mr_sub, subscription, mr_pub, app, app_conf):
"""
Processes AAI UPDATE events for each filtered xNFs where orchestration status is set to Active.
@@ -48,6 +48,7 @@ def process_aai_events(mr_sub, subscription, mr_pub, app):
subscription (Subscription): The current subscription object
mr_pub (_MrPub): MR publisher
app (db): DB application
+ app_conf (AppConfig): the application configuration.
"""
app.app_context().push()
aai_events = mr_sub.get_from_topic('AAI-EVENT')
@@ -65,10 +66,10 @@ def process_aai_events(mr_sub, subscription, mr_pub, app):
new_status = aai_xnf['orchestration-status']
if NetworkFunctionFilter(**subscription.nfFilter).is_nf_in_filter(xnf_name):
- _process_event(action, new_status, xnf_name, subscription, mr_pub)
+ _process_event(action, new_status, xnf_name, subscription, mr_pub, app_conf)
-def _process_event(action, new_status, xnf_name, subscription, mr_pub):
+def _process_event(action, new_status, xnf_name, subscription, mr_pub, app_conf):
if action == AAIEvent.UPDATE.value:
logger.debug(f'Update event found for network function {xnf_name}')
local_xnf = NetworkFunction.get(xnf_name)
@@ -76,7 +77,7 @@ def _process_event(action, new_status, xnf_name, subscription, mr_pub):
if local_xnf is None:
logger.debug(f'Activating subscription for network function {xnf_name}')
subscription.process_subscription([NetworkFunction(
- nf_name=xnf_name, orchestration_status=new_status)], mr_pub)
+ nf_name=xnf_name, orchestration_status=new_status)], mr_pub, app_conf)
else:
logger.debug(f"Update Event for network function {xnf_name} will not be processed "
f" as it's state is set to {local_xnf.orchestration_status}.")