From c359095f9569daf9a7d875153a3872c7cb4baf1b Mon Sep 17 00:00:00 2001 From: ajay_dp001 Date: Thu, 25 Feb 2021 22:28:58 +0530 Subject: [DCAEGEN-2] Added Junit for nfFilter schema validation Issue-ID: DCAEGEN2-2637 Signed-off-by: ajay_dp001 Change-Id: I52192460e4f68f6ef7661e81487dcdd9fc286562 --- components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'components/pm-subscription-handler/pmsh_service') 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 7b91a307..a5fc86e6 100755 --- a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py +++ b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py @@ -128,10 +128,7 @@ class AppConfig: sub_data = self.subscription.__dict__ validate(instance=sub_data, schema=self.sub_schema) nf_filter = sub_data["nfFilter"] - for filter_name in nf_filter: - if len(nf_filter[filter_name]) > 0: - break - else: + if not [filter_name for filter_name, val in nf_filter.items() if len(val) > 0]: raise ValidationError("At least one filter within nfFilter must not be empty") logger.debug("Subscription schema is valid.") -- cgit 1.2.3-korg