From e3809523050df75ec18bf31a5dc3a2e595d58a14 Mon Sep 17 00:00:00 2001 From: Sumukha Tumkur Vani Date: Wed, 27 Jul 2022 15:17:12 -0700 Subject: [PATCH] Change response message for conflicting VNI (#117) Ref: https://github.com/Azure/sonic-restapi/pull/99 --- go-server-server/go/default.go | 2 +- test/test_restapi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go-server-server/go/default.go b/go-server-server/go/default.go index e23c22d..19324a8 100644 --- a/go-server-server/go/default.go +++ b/go-server-server/go/default.go @@ -967,7 +967,7 @@ func ConfigVrouterVrfIdPost(w http.ResponseWriter, r *http.Request) { guid := CacheGetVniId(uint32(attr.Vnid)) if guid != "" { WriteRequestErrorWithSubCode(w, http.StatusConflict, RESRC_EXISTS, - "Object already exists {\"vni\":\"" + strconv.Itoa(attr.Vnid) + "\", \"vnet_name\":\"" + guid +"\"}", []string{}, "") + "Object already exists: {\"vni\":\"" + strconv.Itoa(attr.Vnid) + "\", \"vnet_name\":\"" + guid +"\"}", []string{}, "") return } diff --git a/test/test_restapi.py b/test/test_restapi.py index afeab0d..4a54335 100644 --- a/test/test_restapi.py +++ b/test/test_restapi.py @@ -154,7 +154,7 @@ def test_post_vrouter_duplicate(self, setup_restapi_client): 'vnid': 1001 }) assert r.status_code == 409 - assert r.json()['error']['message'] == "Object already exists {\"vni\":\"1001\", \"vnet_name\":\"vnet-guid-1\"}" + assert r.json()['error']['message'] == "Object already exists: {\"vni\":\"1001\", \"vnet_name\":\"vnet-guid-1\"}" def test_post_vrouter_default(self, setup_restapi_client): _, _, configdb, restapi_client = setup_restapi_client