From: 36970 Date: Mon, 1 Apr 2024 16:56:07 +0000 (+0000) Subject: Coverity(phase 2)-CEW 561: Dead Code X-Git-Tag: release-v16.0-start~14 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F14297%2F1;p=osm%2Fosmclient.git Coverity(phase 2)-CEW 561: Dead Code Added fix for CWE 561: Dead Code(Logically dead code) Change-Id: Idcc650b93feb013330f7fc4156104c6c311b751d Signed-off-by: 36970 --- diff --git a/osmclient/sol005/subscription.py b/osmclient/sol005/subscription.py index d4860ac..e58ef63 100644 --- a/osmclient/sol005/subscription.py +++ b/osmclient/sol005/subscription.py @@ -127,12 +127,10 @@ class Subscription(object): "{}/{}".format(self._apiBase, subscription_id) ) self._logger.debug(yaml.safe_dump(resp)) - if resp: - return json.loads(resp) if not resp or "id" not in resp: raise ClientException( "failed to get subscription info: {}".format(resp) ) - return resp + return json.loads(resp) except NotFound: raise NotFound("subscription '{}' not found".format(subscription_id))