From ca20093c544d7ec5ce9e5efe8003576a4ce2e23c Mon Sep 17 00:00:00 2001 From: Bin Yang Date: Tue, 28 Mar 2017 10:54:27 +0800 Subject: Fix issue of server API Add name field in response Change-Id: I5b9c9b37b6760962667bd136e1a9b48974048f0d Issue-Id: MULTIVIM-57 Signed-off-by: Bin Yang --- newton/newton/requests/views/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'newton') diff --git a/newton/newton/requests/views/server.py b/newton/newton/requests/views/server.py index 51a0efa6..5aec1905 100644 --- a/newton/newton/requests/views/server.py +++ b/newton/newton/requests/views/server.py @@ -135,7 +135,8 @@ class Servers(APIView): logger.debug("Servers--post::> %s" % request.data) try: # check if created already: check name - query = "name=%s" % request.data["name"] + servername = request.data["name"] + query = "name=%s" % servername content, status_code = self.get_servers(query, vimid, tenantid) existed = False if status_code == 200: @@ -234,6 +235,7 @@ class Servers(APIView): resp_body["volumeArray"] = volumearray resp_body["nicArray"] = nicarray resp_body["contextArray"] = contextarray + resp_body["name"] = servername return Response(data=resp_body, status=resp.status_code) except VimDriverNewtonException as e: return Response(data={'error': e.content}, status=e.status_code) -- cgit 1.2.3-korg