From: Victor Morales Date: Thu, 10 May 2018 21:14:37 +0000 (-0700) Subject: Improve _get_list_resources Registraty method X-Git-Tag: v1.1.2~38 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F33%2F47133%2F1;p=multicloud%2Fopenstack.git Improve _get_list_resources Registraty method The logic implemented into the _get_list_resources function for ocata had an unnecessary conditional. This change refactors the implementation. Change-Id: Ic70dfd0b6d7f9f5599381a7179e5990310a25732 Signed-off-by: Victor Morales Issue-ID: MULTICLOUD-214 --- diff --git a/share/newton_base/registration/registration.py b/share/newton_base/registration/registration.py index 726eb691..67004390 100644 --- a/share/newton_base/registration/registration.py +++ b/share/newton_base/registration/registration.py @@ -47,12 +47,9 @@ class Registry(APIView): self._logger.info("request returns with status %s" % resp.status_code) if resp.status_code == status.HTTP_200_OK: self._logger.debug("with content:%s" % resp.json()) - pass - content = resp.json() - - if resp.status_code != status.HTTP_200_OK: - return # failed to discover resources - return content.get(content_key) + content = resp.json() + return content.get(content_key) + return # failed to discover resources def _update_resoure(self, cloud_owner, cloud_region_id, resoure_id, resource_info, resource_type):