summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormalar <malarvizhi.44@wipro.com>2022-08-29 05:49:52 +0000
committermalar <malarvizhi.44@wipro.com>2022-09-02 07:10:40 +0000
commit3ed43723bbc8119dcccbf5d2a018c6d29cb96c58 (patch)
treeeacf99b64dc0cf85d1d646800579e61fbba9b963
parent74659f0cb7619ce2622f8655201db8d96f16300f (diff)
Fix bug while fetching DCAE response
Issue-ID: OPTFRA-1089 Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com> Change-Id: I368a7e69e06bacd645d3098987a052994f0b0754
-rw-r--r--conductor/conductor/data/plugins/inventory_provider/dcae.py13
-rw-r--r--conductor/requirements.txt1
2 files changed, 8 insertions, 6 deletions
diff --git a/conductor/conductor/data/plugins/inventory_provider/dcae.py b/conductor/conductor/data/plugins/inventory_provider/dcae.py
index 02f7c79..4b6d8d1 100644
--- a/conductor/conductor/data/plugins/inventory_provider/dcae.py
+++ b/conductor/conductor/data/plugins/inventory_provider/dcae.py
@@ -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:
diff --git a/conductor/requirements.txt b/conductor/requirements.txt
index 36bd314..eb6eba6 100644
--- a/conductor/requirements.txt
+++ b/conductor/requirements.txt
@@ -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