Commit 26400f92 authored by Giorgos Verigakis's avatar Giorgos Verigakis
Browse files

Merge branch 'api-current' into api-tests

parents ae644a7a 79116511
......@@ -76,7 +76,7 @@ def get_console(request, vm, args):
passwd = random_password()
request_vnc_forwarding(sport, daddr, dport, passwd)
vnc = { 'host': socket.getfqdn(), 'port': sport, 'password': passwd }
vnc = { 'host': getfqdn(), 'port': sport, 'password': passwd }
# Format to be reviewed by [verigak], FIXME
if request.serialization == 'xml':
......
......@@ -14,7 +14,7 @@ from synnefo.api.faults import BadRequest, ItemNotFound
from synnefo.api.util import *
from synnefo.db.models import Image, Flavor, VirtualMachine, VirtualMachineMetadata
from synnefo.logic.utils import get_rsapi_state
from synnefo.util.rapi import GanetiRapiClient
from synnefo.util.rapi import GanetiRapiClient, GanetiApiError
from synnefo.logic import backend
import logging
......@@ -198,9 +198,9 @@ def create_server(request):
pnode=rapi.GetNodes()[0], #TODO: verify if this is necessary
dry_run=dry_run,
beparams=dict(auto_balance=True, vcpus=flavor.cpu, memory=flavor.ram))
except Exception, e:
except GanetiApiError:
vm.delete()
raise e
raise ServiceUnavailable('Could not create server.')
for key, val in metadata.items():
VirtualMachineMetadata.objects.create(meta_key=key, meta_value=val, vm=vm)
......
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