Commit 9aac4f3f by Guba Sándor

node: replaced Exception to WorkerNotFound

parent 437844f1
...@@ -11,7 +11,7 @@ from celery.exceptions import TimeoutError ...@@ -11,7 +11,7 @@ from celery.exceptions import TimeoutError
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from taggit.managers import TaggableManager from taggit.managers import TaggableManager
from common.models import method_cache from common.models import method_cache, WorkerNotFound
from firewall.models import Host from firewall.models import Host
from ..tasks import vm_tasks from ..tasks import vm_tasks
from .common import Trait from .common import Trait
...@@ -117,7 +117,7 @@ class Node(TimeStampedModel): ...@@ -117,7 +117,7 @@ class Node(TimeStampedModel):
if vm_tasks.check_queue(self.host.hostname, queue_id): if vm_tasks.check_queue(self.host.hostname, queue_id):
return self.host.hostname + "." + queue_id return self.host.hostname + "." + queue_id
else: else:
raise Exception("Worker not found.") raise WorkerNotFound()
def remote_query(self, task, timeout=30, raise_=False, default=None): def remote_query(self, task, timeout=30, raise_=False, default=None):
"""Query the given task, and get the result. """Query the given task, and get the result.
......
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 sign in to comment