summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-05-10 14:14:37 -0700
committerVictor Morales <victor.morales@intel.com>2018-05-10 14:14:37 -0700
commit6b2ce042cbd934635f97c9e3a75b7d144e5c3dfb (patch)
treecbe7884d75348856f707a39fa6113556389f999f /share
parent408bbd742c250bf66611c577eb3af4496b70d525 (diff)
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 <victor.morales@intel.com> Issue-ID: MULTICLOUD-214
Diffstat (limited to 'share')
-rw-r--r--share/newton_base/registration/registration.py9
1 files changed, 3 insertions, 6 deletions
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):