From: Zack Cerza Date: Tue, 30 Sep 2014 19:35:13 +0000 (-0600) Subject: Move ScheduleFailError to exceptions module X-Git-Tag: 1.1.0~1137 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=05a7944cf25a264883b28a60420f32a381853d99;p=teuthology.git Move ScheduleFailError to exceptions module Signed-off-by: Zack Cerza --- diff --git a/teuthology/exceptions.py b/teuthology/exceptions.py index 1a3056e527..56bb43256e 100644 --- a/teuthology/exceptions.py +++ b/teuthology/exceptions.py @@ -65,3 +65,15 @@ class ConnectionLostError(Exception): return "SSH connection was lost: {command!r}".format( command=self.command, ) + + +class ScheduleFailError(RuntimeError): + def __init__(self, message, name=None): + self.message = message + self.name = name + + def __str__(self): + return "Job scheduling {name} failed: {msg}".format( + name=self.name, + msg=self.message, + ).replace(' ', ' ') diff --git a/teuthology/suite.py b/teuthology/suite.py index c930209968..779db17b63 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -19,7 +19,7 @@ from tempfile import NamedTemporaryFile import teuthology from . import lock from .config import config, JobConfig -from .exceptions import BranchNotFoundError +from .exceptions import BranchNotFoundError, ScheduleFailError from .repo_utils import fetch_qa_suite, fetch_teuthology log = logging.getLogger(__name__) @@ -311,18 +311,6 @@ def schedule_fail(message, name=''): raise ScheduleFailError(message, name) -class ScheduleFailError(RuntimeError): - def __init__(self, message, name=None): - self.message = message - self.name = name - - def __str__(self): - return "Job scheduling {name} failed: {msg}".format( - name=self.name, - msg=self.message, - ).replace(' ', ' ') - - def get_worker(machine_type): """ Map a given machine_type to a beanstalkd worker. If machine_type mentions