Current File : //usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyc |
�
.�t_c @ sx d Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d
� � YZ d S( s&
ExitStatusMixins - Mixins for exceptions to associate distinguishing exit
status values
These mixins are defined based on the types of error that can occur.
Each mixin is assigned a specific exit status value to disambiguate the
error type via exit status of user-facing utilities.
The values start at 3 to provide distinction from common failure exit
statuses (1 - something went wrong, 2 - argument error) that may be produced
by user-facing utilities.
In accord with mixin best practices these mixins are to be specified
*before* an exception's superclass exception in the exception's definition.
This allows for a subsystem base exception to provide a subsystem-wide
exit status and for subsystem specific exceptions to specialize the
exit status as appropriate.
To avoid subclass proliferation simply to provide specific exit statuses
one can chose to create a subsystem base exception using any of the
ExitStatus hierachy classes (though, generally, one should probably only
use ExitStatus itself) and provide a specific exit status for an exception
at instantiation by passing any of the ExitStatus hierarchy classes as the
'exitStatus' instantiation parameter.
$Id: //eng/vdo-releases/magnesium/src/python/vdo/vdomgmnt/ExitStatusMixins.py#1 $
t
ExitStatusc B s/ e Z d Z d Z e d � � Z d d � Z RS( s� Base class for all ExistStatusMixins.
Provides a default exit status value to be interpreted solely as an
error occurred.
i c C s | j d k r | j j S| j S( N( t _exitStatust Nonet _exitStatusMixinValue( t self( ( sA /usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyt
exitStatus; s
c O sl t t | � j | | � | | _ | j d k rh t | j t � rh t d j t | j � j � � � n d S( Ns {0} is not an ExitStatus mixin(
t superR t __init__R R t
issubclasst TypeErrort formatt typet __name__( R R t argst kwargs( ( sA /usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyR D s N( R t
__module__t __doc__R t propertyR R R ( ( ( sA /usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyR 1 s t DeveloperExitStatusc B s e Z d Z d Z RS( sE Used to represent an error condition due to a developer oversight.
i ( R R R R ( ( ( sA /usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyR N s t StateExitStatusc B s e Z d Z d Z RS( sH Used to represent an error condition due to the state of some entity.
i ( R R R R ( ( ( sA /usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyR T s t SystemExitStatusc B s e Z d Z d Z RS( sn Used to represent an error condition due to a failure on the part of
the operating system, hardware, etc.
i ( R R R R ( ( ( sA /usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyR Z s t UserExitStatusc B s e Z d Z d Z RS( sn Used to represent an error condition due to the user; e.g., bad parameter,
insufficient permissions, etc.
i ( R R R R ( ( ( sA /usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyR a s N( R t objectR R R R R ( ( ( sA /usr/lib/python2.7/site-packages/vdo/vdomgmnt/ExitStatusMixins.pyt <module>/ s