~ubuntu-branches/ubuntu/utopic/cinder/utopic

« back to all changes in this revision

Viewing changes to cinder/taskflow/exceptions.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, James Page, Adam Gandelman, Chuck Short
  • Date: 2013-09-08 21:09:46 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20130908210946-3dbzq1jy5uji4wad
Tags: 1:2013.2~b3-0ubuntu1
[ James Page ]
* d/control: Switch ceph-common -> python-ceph inline with upstream
  refactoring of Ceph RBD driver, move to Suggests of python-cinder.
  (LP: #1190791). 

[ Adam Gandelman ]
* debian/patches/avoid_paramiko_vers_depends.patch: Dropped, no longer
  required.
* Add minimum requirement python-greenlet (>= 0.3.2).
* Add minimum requirement python-eventlet (>= 0.12.0).
* Add minimum requirement python-paramiko (>= 1.8).

[ Chuck Short ]
* New upstream release.
* debian/patches/skip-sqlachemy-failures.patch: Skip testfailures
  with sqlalchemy 0.8 until they are fixed upstream.
* debian/control: Add python-babel to build-depends.
* debian/control: Add python-novaclient to build-depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
 
 
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 
4
 
 
5
#    Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
 
6
#
 
7
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
8
#    not use this file except in compliance with the License. You may obtain
 
9
#    a copy of the License at
 
10
#
 
11
#         http://www.apache.org/licenses/LICENSE-2.0
 
12
#
 
13
#    Unless required by applicable law or agreed to in writing, software
 
14
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
15
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
16
#    License for the specific language governing permissions and limitations
 
17
#    under the License.
 
18
 
 
19
 
 
20
class TaskFlowException(Exception):
 
21
    """Base class for exceptions emitted from this library."""
 
22
    pass
 
23
 
 
24
 
 
25
class Duplicate(TaskFlowException):
 
26
    """Raised when a duplicate entry is found."""
 
27
    pass
 
28
 
 
29
 
 
30
class NotFound(TaskFlowException):
 
31
    """Raised when some entry in some object doesn't exist."""
 
32
    pass
 
33
 
 
34
 
 
35
class AlreadyExists(TaskFlowException):
 
36
    """Raised when some entry in some object already exists."""
 
37
    pass
 
38
 
 
39
 
 
40
class ClosedException(TaskFlowException):
 
41
    """Raised when an access on a closed object occurs."""
 
42
    pass
 
43
 
 
44
 
 
45
class InvalidStateException(TaskFlowException):
 
46
    """Raised when a task/job/workflow is in an invalid state when an
 
47
    operation is attempting to apply to said task/job/workflow.
 
48
    """
 
49
    pass
 
50
 
 
51
 
 
52
class UnclaimableJobException(TaskFlowException):
 
53
    """Raised when a job can not be claimed."""
 
54
    pass
 
55
 
 
56
 
 
57
class JobNotFound(TaskFlowException):
 
58
    """Raised when a job entry can not be found."""
 
59
    pass
 
60
 
 
61
 
 
62
class MissingDependencies(InvalidStateException):
 
63
    """Raised when a task has dependencies that can not be satisified."""
 
64
    message = ("%(task)s requires %(requirements)s but no other task produces"
 
65
               " said requirements")
 
66
 
 
67
    def __init__(self, task, requirements):
 
68
        message = self.message % {'task': task, 'requirements': requirements}
 
69
        super(MissingDependencies, self).__init__(message)