]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Move ScheduleFailError to exceptions module
authorZack Cerza <zack.cerza@inktank.com>
Tue, 30 Sep 2014 19:35:13 +0000 (13:35 -0600)
committerZack Cerza <zack.cerza@inktank.com>
Tue, 30 Sep 2014 19:35:13 +0000 (13:35 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/exceptions.py
teuthology/suite.py

index 1a3056e5276013402d43c8be3b5c19c9c962c356..56bb43256e1d36f2036bf6cc858e72556e220cce 100644 (file)
@@ -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('  ', ' ')
index c93020996853d95c50ae36b2b37f4307a19d04d3..779db17b63030404db82726c7e10e0edbd09c026 100644 (file)
@@ -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