summaryrefslogtreecommitdiffstats
path: root/newton
diff options
context:
space:
mode:
Diffstat (limited to 'newton')
-rw-r--r--newton/newton/requests/views/server.py4
1 files changed, 3 insertions, 1 deletions
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)