Commit bac419e2 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed error handling on election.

parent e1ee44e0
......@@ -9,7 +9,8 @@ from __future__ import absolute_import
from copy import copy
from ccserver.exceptions import UnknownElectionAlgo, UnknownElectionType
from ccserver.exceptions import (UnknownElectionAlgo, UnknownElectionType,
def tags(*args):
......@@ -126,10 +127,8 @@ class Elector(object):
hv_alloc = {}
for vm, hvs in candidates:
if not hvs:
migration_plan.append({'sid': vm['id'],
'did': '',
'error': 'no destination hv found',
'type': 'error'})
raise ElectionError('No destination found for %r vm' % vm['id'])
# Try to take an hypervisor that is not already in the plan:
for hv in hvs:
......@@ -56,3 +56,7 @@ class UnknownMigrationType(Exception):
class UnknownObjectError(Exception):
class ElectionError(Exception):
......@@ -709,6 +709,7 @@ class CliHandler(OnlineCCHandler):
errmsg = '%r unknown migration type' % migration['type']
errs.error(migration['sid'], errmsg)
# Construct the migration properties:
migration_properties = {
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