Merge "Improve error message for AggregateAlreadyHasHost exception"
This commit is contained in:
commit
7ee3c800ea
|
@ -48,7 +48,8 @@ class AggregateHaveHost(exceptions.BlazarException):
|
|||
|
||||
class AggregateAlreadyHasHost(exceptions.BlazarException):
|
||||
code = 409
|
||||
msg_fmt = _("Aggregate %(pool)s already has host(s) %(host)s ")
|
||||
msg_fmt = _("Conflict while adding host %(host)s to aggregate %(pool)s: "
|
||||
"%(nova_exception)s")
|
||||
|
||||
|
||||
class AggregateNotFound(exceptions.NotFound):
|
||||
|
|
|
@ -365,9 +365,9 @@ class ReservationPool(NovaClientWrapper):
|
|||
return self.nova.aggregates.add_host(agg.id, host)
|
||||
except nova_exception.NotFound:
|
||||
raise manager_exceptions.HostNotFound(host=host)
|
||||
except nova_exception.Conflict:
|
||||
raise manager_exceptions.AggregateAlreadyHasHost(pool=pool,
|
||||
host=host)
|
||||
except nova_exception.Conflict as e:
|
||||
raise manager_exceptions.AggregateAlreadyHasHost(
|
||||
pool=pool, host=host, nova_exception=str(e))
|
||||
|
||||
def remove_all_computehosts(self, pool):
|
||||
"""Remove all compute hosts attached to an aggregate."""
|
||||
|
|
Loading…
Reference in New Issue