Commit f1a08381 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Add message to exceptions

parent 42e027fb
...@@ -121,7 +121,8 @@ class Backend(models.Model): ...@@ -121,7 +121,8 @@ class Backend(models.Model):
def get_client(self): def get_client(self):
"""Get or create a client. """ """Get or create a client. """
if self.offline: if self.offline:
raise faults.ServiceUnavailable raise faults.ServiceUnavailable("Backend '%s' is offline" %
return get_rapi_client(, self.hash, return get_rapi_client(, self.hash,
self.clustername, self.clustername,
self.port, self.port,
...@@ -344,7 +345,7 @@ class VirtualMachine(models.Model): ...@@ -344,7 +345,7 @@ class VirtualMachine(models.Model):
if self.backend: if self.backend:
return self.backend.get_client() return self.backend.get_client()
else: else:
raise faults.ServiceUnavailable raise faults.ServiceUnavailable("VirtualMachine without backend")
def get_last_diagnostic(self, **filters): def get_last_diagnostic(self, **filters):
try: try:
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