diff options
-rw-r--r-- | kilo/kilo/requests/views/server.py | 4 | ||||
-rw-r--r-- | newton/newton/requests/views/server.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/kilo/kilo/requests/views/server.py b/kilo/kilo/requests/views/server.py index 75b0a87c..0da19c44 100644 --- a/kilo/kilo/requests/views/server.py +++ b/kilo/kilo/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: @@ -235,6 +236,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 VimDriverKiloException as e: return Response(data={'error': e.content}, status=e.status_code) 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) |