]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Remove unused exceptions from cinder/exception.py
authorRongzeZhu <zrzhit@gmail.com>
Wed, 22 Aug 2012 03:37:26 +0000 (11:37 +0800)
committerRongzeZhu <zrzhit@gmail.com>
Wed, 22 Aug 2012 03:37:26 +0000 (11:37 +0800)
commit938d92e8a9a2ee97fb7951ed232b58d614a27adf
treedffa82c51cc214b58ad430b13969612c23dc42b3
parent4e81c907bbb9d94d4b76b00ff591418374175d41
Remove unused exceptions from cinder/exception.py

find cinder/ -type f -name "*pyc" -exec rm {} \;
exceptions=`cat cinder/exception.py| grep -E '^class' |\
 awk {'print $2'} | awk -F '(' {'print $1'}`
for exc in $exceptions
do
    i=`find cinder/ -type f -exec grep -R $exc {} \; |wc -l`
    if [ $i -eq 1 ]
    then
        echo $exc
    fi
done

First removed exceptions:

DecryptionFailure
ImagePaginationFailed
VirtualInterfaceCreateException
VirtualInterfaceMacAddressException
MelangeConnectionFailed
VolumeUnattached
InvalidKeypair
InvalidSignature
InvalidInstanceType
InvalidIpProtocol
InvalidCidr
InvalidAggregateAction
InvalidGroup
InstanceInvalidState
InstanceNotRunning
InstanceNotSuspended
InstanceNotInRescueMode
InstanceSuspendFailure
InstanceResumeFailure
InstanceRebootFailure
InstanceTerminationFailure
VolumeServiceUnavailable
UnableToMigrateToSelf
DestinationHostUnavailable
SourceHostUnavailable
InvalidHypervisorType
DestinationHypervisorTooOld
DestinationDiskExists
InvalidDevicePath
DeviceIsBusy
InvalidCPUInfo
InvalidIpAddressError
InvalidVLANTag
InvalidVLANPortGroup
InvalidDiskFormat
InstanceUnacceptable
FlagNotSet
NoVolumeTypesFound
VolumeDriverNotFound
ListingImageRefsNotSupported
KernelNotFoundForImage
ProjectNotFound
ProjectMembershipNotFound
UserRoleNotFound
StorageRepositoryNotFound
DatastoreNotFound
FixedIpNotFoundForAddress
FixedIpNotFoundForInstance
FixedIpNotFoundForNetworkHost
FixedIpNotFoundForSpecificInstance
FixedIpNotFoundForHost
FixedIpAlreadyInUse
FixedIpInvalid
NoMoreFixedIps
NoFixedIpsDefined
FloatingIpDNSExists
FloatingIpNotFoundForAddress
FloatingIpNotFoundForHost
NoMoreFloatingIps
FloatingIpAssociated
FloatingIpNotAssociated
NoFloatingIpsDefined
NoFloatingIpInterface
KeypairNotFound
CertificateNotFound
AuthTokenNotFound
AccessKeyNotFound
SecurityGroupNotFoundForProject
SecurityGroupNotFoundForRule
SecurityGroupExistsForInstance
SecurityGroupNotExistsForInstance
NoInstanceTypesFound
InstanceTypeNotFoundByName
FlavorNotFound
CellNotFound
SchedulerHostFilterNotFound
SchedulerCostFunctionNotFound
SchedulerWeightFlagNotFound
InstanceMetadataNotFound
InstanceTypeExtraSpecsNotFound
LDAPUserNotFound
LDAPGroupNotFound
LDAPGroupMembershipNotFound
NoFilesFound
SwitchNotFoundForNetworkAdapter
NetworkAdapterNotFound
GlobalRoleNotAllowed
ImageRotationNotAllowed
RotationRequiredForBackup
LDAPUserExists
LDAPGroupExists
LDAPMembershipExists
ProjectExists
InstanceExists
InstanceTypeExists
InvalidSharedStorage
CannotResizeToSameSize
ImageTooLarge
ZoneRequestError
InstanceTypeMemoryTooSmall
InstanceTypeDiskTooSmall
InsufficientFreeMemory
CouldNotFetchMetrics
AggregateError
AggregateNotFound
AggregateNameExists
AggregateHostNotFound
AggregateMetadataNotFound
AggregateHostConflict
AggregateHostExists
InstanceTypeCreateFailed
SolidFireAPIStatusException
DuplicateVlan
InvalidInstanceIDMalformed
CouldNotFetchImage

Search again, Second removed exceptions:

UserNotFound
FixedIpNotFoundForNetwork
FloatingIpNotFound
SecurityGroupNotFound
InstanceTypeNotFound
LDAPObjectNotFound
UserExists

Search again, Third removed exceptions:

FixedIpNotFound

Change-Id: I028122c6132340b2fef2c144da787b7c4efddccf
cinder/exception.py