summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrishna moorthy <krishnamoorthy.manoharan@stl.tech>2022-09-19 04:58:54 +0000
committerGerrit Code Review <gerrit@onap.org>2022-09-19 04:58:54 +0000
commitb567159373a6e1bc2949ed88278eeed17f47b542 (patch)
tree6e12b4de1c04a10ea08afef2e433be7443e73ba0
parentf2ede89a22691ad7c9a1181c4adbd09465d0c2a7 (diff)
parent3ed43723bbc8119dcccbf5d2a018c6d29cb96c58 (diff)
Merge "Fix bug while fetching DCAE response"
-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