<s> from novaclient import exceptions as _nova_exceptions <EOL> ServerNotFound = _nova_exceptions . NotFound <EOL> ServerClientException = _nova_exceptions . ClientException <EOL> class PyraxException ( Exception ) : <EOL> pass <EOL> class AccessListIDNotFound ( PyraxException ) : <EOL> pass <EOL> class AuthenticationFailed ( PyraxException ) : <EOL> pass <EOL> class AuthorizationFailure ( PyraxException ) : <EOL> pass <EOL> class AuthSystemNotFound ( PyraxException ) : <EOL> pass <EOL> class CDNFailed ( PyraxException ) : <EOL> pass <EOL> class DBUpdateUnchanged ( PyraxException ) : <EOL> pass <EOL> class DNSCallTimedOut ( PyraxException ) : <EOL> pass <EOL> class DomainCreationFailed ( PyraxException ) : <EOL> pass <EOL> class DomainDeletionFailed ( PyraxException ) : <EOL> pass <EOL> class DomainRecordAdditionFailed ( PyraxException ) : <EOL> pass <EOL> class DomainRecordDeletionFailed ( PyraxException ) : <EOL> pass <EOL> class DomainRecordNotFound ( PyraxException ) : <EOL> pass <EOL> class DomainRecordNotUnique ( PyraxException ) : <EOL> pass <EOL> class DomainRecordUpdateFailed ( PyraxException ) : <EOL> pass <EOL> class DomainUpdateFailed ( PyraxException ) : <EOL> pass <EOL> class DuplicateQueue ( PyraxException ) : <EOL> pass <EOL> class DuplicateUser ( PyraxException ) : <EOL> pass <EOL> class EndpointNotDefined ( PyraxException ) : <EOL> pass <EOL> class EndpointNotFound ( PyraxException ) : <EOL> pass <EOL> class EnvironmentNotFound ( PyraxException ) : <EOL> pass <EOL> class FlavorNotFound ( PyraxException ) : <EOL> pass <EOL> class FileNotFound ( PyraxException ) : <EOL> pass <EOL> class FolderNotFound ( PyraxException ) : <EOL> pass <EOL> class KeyringModuleNotInstalled ( PyraxException ) : <EOL> pass <EOL> class KeyringPasswordNotFound ( PyraxException ) : <EOL> pass <EOL> class KeyringUsernameMissing ( PyraxException ) : <EOL> pass <EOL> class IdentityClassNotDefined ( PyraxException ) : <EOL> pass <EOL> class InternalServerError ( PyraxException ) : <EOL> pass <EOL> class InvalidCDNMetadata ( PyraxException ) : <EOL> pass <EOL> class InvalidConfigurationFile ( PyraxException ) : <EOL> pass <EOL> class InvalidCredentialFile ( PyraxException ) : <EOL> pass <EOL> class InvalidDateTimeString ( PyraxException ) : <EOL> pass <EOL> class InvalidDeviceType ( PyraxException ) : <EOL> pass <EOL> class InvalidEmail ( PyraxException ) : <EOL> pass <EOL> class InvalidImageMember ( PyraxException ) : <EOL> pass <EOL> class InvalidImageMemberStatus ( PyraxException ) : <EOL> pass <EOL> class InvalidLoadBalancer ( PyraxException ) : <EOL> pass <EOL> class InvalidLoadBalancerParameters ( PyraxException ) : <EOL> pass <EOL> class InvalidImageMemberStatus ( PyraxException ) : <EOL> pass <EOL> class InvalidMonitoringCheckDetails ( PyraxException ) : <EOL> pass <EOL> class InvalidMonitoringCheckUpdate ( PyraxException ) : <EOL> pass <EOL> class InvalidMonitoringMetricsRequest ( PyraxException ) : <EOL> pass <EOL> class InvalidMonitoringMetricsResolution ( PyraxException ) : <EOL> pass <EOL> class InvalidNodeCondition ( PyraxException ) : <EOL> pass <EOL> class InvalidNodeParameters ( PyraxException ) : <EOL> pass <EOL> class InvalidPTRRecord ( PyraxException ) : <EOL> pass <EOL> class InvalidQueueName ( PyraxException ) : <EOL> pass <EOL> class InvalidSessionPersistenceType ( PyraxException ) : <EOL> pass <EOL> class InvalidSetting ( PyraxException ) : <EOL> pass <EOL> class InvalidSize ( PyraxException ) : <EOL> pass <EOL> class InvalidTemporaryURLMethod ( PyraxException ) : <EOL> pass <EOL> class InvalidUploadID ( PyraxException ) : <EOL> pass <EOL> class InvalidVirtualIPType ( PyraxException ) : <EOL> pass <EOL> class InvalidVirtualIPVersion ( PyraxException ) : <EOL> pass <EOL> class InvalidVolumeResize ( PyraxException ) : <EOL> pass <EOL> class MissingAuthSettings ( PyraxException ) : <EOL> pass <EOL> class MissingClaimParameters ( PyraxException ) : <EOL> pass <EOL> class MissingDBUserParameters ( PyraxException ) : <EOL> pass <EOL> class MissingDNSSettings ( PyraxException ) : <EOL> pass <EOL> class MissingHealthMonitorSettings ( PyraxException ) : <EOL> pass <EOL> class MissingLoadBalancerParameters ( PyraxException ) : <EOL> pass <EOL> class MissingMonitoringCheckDetails ( PyraxException ) : <EOL> pass <EOL> class MissingMonitoringCheckGranularity ( PyraxException ) : <EOL> pass <EOL> class MissingName ( PyraxException ) : <EOL> pass <EOL> class MissingTemporaryURLKey ( PyraxException ) : <EOL> pass <EOL> class MonitoringCheckTargetNotSpecified ( PyraxException ) : <EOL> pass <EOL> class MonitoringZonesPollMissing ( PyraxException ) : <EOL> pass <EOL> class NetworkCIDRInvalid ( PyraxException ) : <EOL> pass <EOL> class NetworkCIDRMalformed ( PyraxException ) : <EOL> pass <EOL> class NetworkCountExceeded ( PyraxException ) : <EOL> pass <EOL> class NetworkInUse ( PyraxException ) : <EOL> pass <EOL> class NetworkNotFound ( PyraxException ) : <EOL> pass <EOL> class NetworkLabelNotUnique ( PyraxException ) : <EOL> pass <EOL> class NoClientForService ( PyraxException ) : <EOL> pass <EOL> class NoEndpointForRegion ( PyraxException ) : <EOL> pass <EOL> class NoEndpointForService ( PyraxException ) : <EOL> pass <EOL> class NoContentSpecified ( PyraxException ) : <EOL> pass <EOL> class NoMoreResults ( PyraxException ) : <EOL> pass <EOL> class NoReloadError ( PyraxException ) : <EOL> pass <EOL> class NoSSLTerminationConfiguration ( PyraxException ) : <EOL> pass <EOL> class NoSuchClient ( PyraxException ) : <EOL> pass <EOL> class NoSuchContainer ( PyraxException ) : <EOL> pass <EOL> class NoSuchDatabase ( PyraxException ) : <EOL> pass <EOL> class NoSuchDatabaseUser ( PyraxException ) : <EOL> pass <EOL> class NoSuchObject ( PyraxException ) : <EOL> pass <EOL> class NotAuthenticated ( PyraxException ) : <EOL> pass <EOL> class NotCDNEnabled ( PyraxException ) : <EOL> pass <EOL> class NoTokenLookupException ( PyraxException ) : <EOL> pass <EOL> class PasswordChangeFailed ( PyraxException ) : <EOL> pass <EOL> class ProtocolMismatch ( PyraxException ) : <EOL> pass <EOL> class PTRRecordCreationFailed ( PyraxException ) : <EOL> pass <EOL> class PTRRecordDeletionFailed ( PyraxException ) : <EOL> pass <EOL> class PTRRecordUpdateFailed ( PyraxException ) : <EOL> pass <EOL> class QueueClientIDNotDefined ( PyraxException ) : <EOL> pass <EOL> class ServiceNotAvailable ( PyraxException ) : <EOL> pass <EOL> class ServiceResponseFailure ( PyraxException ) : <EOL> pass <EOL> class SnapshotNotAvailable ( PyraxException ) : <EOL> pass <EOL> class TenantNotFound ( PyraxException ) : <EOL> pass <EOL> class UnattachedNode ( PyraxException ) : <EOL> pass <EOL> class UnattachedVirtualIP ( PyraxException ) : <EOL> pass <EOL> class UnicodePathError ( PyraxException ) : <EOL> pass <EOL> class UnsharableImage ( PyraxException ) : <EOL> pass <EOL> class UploadFailed ( PyraxException ) : <EOL> pass <EOL> class UserNotFound ( PyraxException ) : <EOL> pass <EOL> class VolumeAttachmentFailed ( PyraxException ) : <EOL> pass <EOL> class VolumeCloneTooSmall ( PyraxException ) : <EOL> pass <EOL> class VolumeDetachmentFailed ( PyraxException ) : <EOL> pass <EOL> class VolumeNotAvailable ( PyraxException ) : <EOL> pass <EOL> class MissingCloudDatabaseParameter ( PyraxException ) : <EOL> pass <EOL> class AmbiguousEndpoints ( PyraxException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , endpoints = None ) : <EOL> self . endpoints = endpoints <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % repr ( self . endpoints ) <EOL> class ClientException ( PyraxException ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , code , message = None , details = None , request_id = None ) : <EOL> self . code = code <EOL> self . message = message or "<STR_LIT>" <EOL> self . details = details <EOL> self . request_id = request_id <EOL> def __str__ ( self ) : <EOL> formatted_string = "<STR_LIT>" % ( self . message , self . code ) <EOL> if self . request_id : <EOL> formatted_string += "<STR_LIT>" % self . request_id <EOL> return formatted_string <EOL> def __reduce__ ( self ) : <EOL> return ( self . __class__ , ( self . code , self . message , <EOL> self . details , self . request_id ) ) <EOL> class BadRequest ( ClientException ) : <EOL> """<STR_LIT>""" <EOL> http_status = <NUM_LIT> <EOL> message = "<STR_LIT>" <EOL> class Unauthorized ( ClientException ) : <EOL> """<STR_LIT>""" <EOL> http_status = <NUM_LIT> <EOL> message = "<STR_LIT>" <EOL> class Forbidden ( ClientException ) : <EOL> """<STR_LIT>""" <EOL> http_status = <NUM_LIT> <EOL> message = "<STR_LIT>" <EOL> class NotFound ( ClientException ) : <EOL> """<STR_LIT>""" <EOL> http_status = <NUM_LIT> <EOL> message = "<STR_LIT>" <EOL> class NoUniqueMatch ( ClientException ) : <EOL> """<STR_LIT>""" <EOL> http_status = <NUM_LIT> <EOL> message = "<STR_LIT>" <EOL> class OverLimit ( ClientException ) : <EOL> """<STR_LIT>""" <EOL> http_status = <NUM_LIT> <EOL> message = "<STR_LIT>" <EOL> class HTTPNotImplemented ( ClientException ) : <EOL> """<STR_LIT>""" <EOL> http_status = <NUM_LIT> <EOL> message = "<STR_LIT>" <EOL> _code_map = dict ( ( c . http_status , c ) for c in [ BadRequest , Unauthorized , <EOL> Forbidden , NotFound , OverLimit , HTTPNotImplemented ] ) <EOL> def from_response ( response , body ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( response , dict ) : <EOL> status = response . get ( "<STR_LIT>" ) <EOL> else : <EOL> status = response . status_code <EOL> cls = _code_map . get ( int ( status ) , ClientException ) <EOL> request_id = response . headers . get ( "<STR_LIT>" ) <EOL> if body : <EOL> message = "<STR_LIT>" <EOL> details = "<STR_LIT>" <EOL> if isinstance ( body , dict ) : <EOL> message = body . get ( "<STR_LIT:message>" ) <EOL> details = body . get ( "<STR_LIT>" ) <EOL> if message is details is None : <EOL> error = body [ body . keys ( ) [ <NUM_LIT:0> ] ] <EOL> if isinstance ( error , dict ) : <EOL> message = error . get ( "<STR_LIT:message>" , None ) <EOL> details = error . get ( "<STR_LIT>" , None ) <EOL> else : <EOL> message = error <EOL> details = None <EOL> else : <EOL> message = body <EOL> return cls ( code = status , message = message , details = details , <EOL> request_id = request_id ) <EOL> else : <EOL> return cls ( code = status , request_id = request_id ) </s>
