From c19a0a85bbbc8dcf0633a32d26f4128f6c8c4544 Mon Sep 17 00:00:00 2001 From: emartin Date: Thu, 27 Feb 2020 13:56:52 +0000 Subject: Update PM subscription event for PMSH * Add control loop name * Remove invariant id reference Issue-ID: DCAEGEN2-2100 Signed-off-by: emartin Change-Id: I6bbb757e07f3d930ecd28bd3106df307a264ff65 --- components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py') diff --git a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py index 9ff0c653..c8b3bc77 100755 --- a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py +++ b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py @@ -37,6 +37,8 @@ class AppConfig: self.key_path = kwargs.get('key_path') self.streams_subscribes = kwargs.get('streams_subscribes') self.streams_publishes = kwargs.get('streams_publishes') + self.operational_policy_name = kwargs.get('operational_policy_name') + self.control_loop_name = kwargs.get('control_loop_name') def get_mr_sub(self, sub_name): """ @@ -127,16 +129,17 @@ class _MrPub(_DmaapMrClient): logger.debug(e) raise - def publish_subscription_event_data(self, subscription, xnf_name): + def publish_subscription_event_data(self, subscription, xnf_name, app_conf): """ Update the Subscription dict with xnf and policy name then publish to DMaaP MR topic. Args: subscription: the `Subscription` object. xnf_name: the xnf to include in the event. + app_conf (AppConfig): the application configuration. """ try: - subscription_event = subscription.prepare_subscription_event(xnf_name) + subscription_event = subscription.prepare_subscription_event(xnf_name, app_conf) self.publish_to_topic(subscription_event) except Exception as e: logger.debug(f'pmsh_utils.publish_subscription_event_data : {e}') @@ -249,6 +252,7 @@ class PeriodicTask(Timer): """ See :class:`Timer`. """ + def run(self): while not self.finished.wait(self.interval): self.function(*self.args, **self.kwargs) -- cgit 1.2.3-korg