aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils/functest_utils.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-21 10:13:45 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-21 10:17:43 +0200
commitbdf5048343f9d3f419bbd16dfb219fa79a9ad694 (patch)
tree235a2a067faaf43080c779cad86d5c55f01bed57 /functest/utils/functest_utils.py
parentcd4e945a2c7246ed27027bcfabfa33fd82a918a9 (diff)
Sort keys when dumping json
Otherwise dumping them could break some unit tests as they are unordered collections [1]. [1] https://build.opnfv.org/ci/job/functest-verify-master/4122/ Change-Id: I108e946926ae9690cf2421e565f2bb81500f9160 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/utils/functest_utils.py')
-rw-r--r--functest/utils/functest_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py
index 284c7971..dc20eea1 100644
--- a/functest/utils/functest_utils.py
+++ b/functest/utils/functest_utils.py
@@ -221,7 +221,8 @@ def push_results_to_db(project, case_name,
error = None
headers = {'Content-Type': 'application/json'}
try:
- r = requests.post(url, data=json.dumps(params), headers=headers)
+ r = requests.post(url, data=json.dumps(params, sort_keys=True),
+ headers=headers)
logger.debug(r)
r.raise_for_status()
except requests.RequestException as exc: