Commit 373ab544 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Refactor code for renaming a server

Created function for renaming a server.
parent a5bd4611
......@@ -414,8 +414,8 @@ def update_server_name(request, server_id):
vm = util.get_vm(server_id, request.user_uniq, for_update=True,
non_suspended=True) = name
servers.rename(vm, new_name=name)
return HttpResponse(status=204)
......@@ -502,3 +502,13 @@ def remove_floating_ip(vm, address):
vm, floating_ip)
return backend.disconnect_from_network(vm, nic)
def rename(server, new_name):
"""Rename a VirtualMachine."""
old_name = = new_name"Renamed server '%s' from '%s' to '%s'", server, old_name,
return server
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment