From 84d5f2dcb68a409af76de545ec02656ccd761e14 Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Wed, 6 Mar 2024 17:05:36 +0100 Subject: SDNC distribution status check fix SDNC distribution status check fix Issue-ID: TEST-404 Signed-off-by: Lukasz Rajewski Change-Id: Icc494a06f622dcebf02846cc00121b6d7ebb45fa --- src/onaptests/steps/onboard/service.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/onaptests') diff --git a/src/onaptests/steps/onboard/service.py b/src/onaptests/steps/onboard/service.py index b482cff..9243d97 100644 --- a/src/onaptests/steps/onboard/service.py +++ b/src/onaptests/steps/onboard/service.py @@ -426,13 +426,13 @@ class VerifyServiceDistributionInSdncStep(BaseServiceDistributionComponentCheckS password=password) cursor = conn.cursor() cursor.execute( - f"SELECT * FROM service_model WHERE service_uuid = '{self.service.uuid}'") - for _ in cursor: - pass - if cursor.rowcount == 0: - msg = f"Service {self.service.name} is missing in SDNC." + f"SELECT * FROM service_model WHERE service_uuid = '{self.service.uuid}';") + cursor.fetchall() + if cursor.rowcount <= 0: + msg = "Service model is missing in SDNC." self._logger.error(msg) raise onap_test_exceptions.ServiceDistributionException(msg) + self._logger.info("Service found in SDNC") cursor.close() except Exception as e: msg = f"Service {self.service.name} is missing in SDNC." -- cgit 1.2.3-korg