Fix bug while fetching DCAE response 66/130466/3
authormalar <malarvizhi.44@wipro.com>
Mon, 29 Aug 2022 05:49:52 +0000 (05:49 +0000)
committermalar <malarvizhi.44@wipro.com>
Fri, 2 Sep 2022 07:10:40 +0000 (07:10 +0000)
Issue-ID: OPTFRA-1089
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: I368a7e69e06bacd645d3098987a052994f0b0754

conductor/conductor/data/plugins/inventory_provider/dcae.py
conductor/requirements.txt

index 02f7c79..4b6d8d1 100644 (file)
@@ -186,7 +186,8 @@ class DCAE(object):
                 else:
                     LOG.debug("No difference attribute was added to the candidate")
             else:
-                candidate = candidate
+                candidate["ulthpt_difference"] = 2
+                candidate["dlthpt_difference"] = 2
                 LOG.debug("Returning original candidate list")
             candidatesList.update(candidate)
             LOG.debug("capacity filter ", candidatesList)
@@ -257,12 +258,12 @@ class DCAE(object):
         dcae_response = self._request('get', path, data=data)
         LOG.debug(self._request('get', path, data=data))
         LOG.debug(" DCAE response : ", dcae_response)
-        LOG.debug("DCAE json response is : ", json.dumps(dcae_response.json()))
-        dcae_response2 = json.dumps(dcae_response.json())
-        LOG.debug(" processed DCAE response is ", dcae_response2)
-        if dcae_response2 is None or dcae_response.status_code != 200:
+        if dcae_response is None or dcae_response.status_code != 200:
             return None
-        if dcae_response2:
+        if dcae_response:
+            LOG.debug("DCAE json response is : ", json.dumps(dcae_response.json()))
+            dcae_response2 = json.dumps(dcae_response.json())
+            LOG.debug(" processed DCAE response is ", dcae_response2)
             responseJson = json.loads(dcae_response2)
             LOG.debug("response json from DCAE is :", responseJson)
             if 'sliceConfigDetails' not in responseJson or len(responseJson['sliceConfigDetails']) == 0:
index 36bd314..eb6eba6 100644 (file)
@@ -31,3 +31,4 @@ jsonschema>=3.2.0
 tosca-parser>=2.2.0
 etcd3==0.12.0
 grpcio==1.42.0
+WebTest==3.0.0