]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Rename qexception->nexception
authorAaron Rosen <aaronorosen@gmail.com>
Mon, 12 Jan 2015 21:55:32 +0000 (13:55 -0800)
committerAaron Rosen <aaronorosen@gmail.com>
Mon, 12 Jan 2015 21:56:46 +0000 (13:56 -0800)
A few qexception references where still present in the code this patch
renames them to nexecption.

find . -name "*.py" -print | xargs sed -i 's/qexception/nexception/g'
TrivialFix

Change-Id: I9530c7a23deb3a40c3720bc8fc99ce09dbd88dd9

13 files changed:
neutron/extensions/external_net.py
neutron/extensions/extraroute.py
neutron/extensions/firewall.py
neutron/extensions/l3.py
neutron/extensions/loadbalancer.py
neutron/extensions/loadbalancerv2.py
neutron/extensions/metering.py
neutron/extensions/multiprovidernet.py
neutron/extensions/portsecurity.py
neutron/extensions/securitygroup.py
neutron/extensions/vpnaas.py
neutron/plugins/bigswitch/extensions/routerrule.py
neutron/plugins/vmware/extensions/qos.py

index 0e24f13f6c71eb619298388f2e5f2b244a1f324a..2a985f9d3ca29193fae97144bfe98e5a6330b46e 100644 (file)
 
 from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron.extensions import l3
 
 
-class ExternalNetworkInUse(qexception.InUse):
+class ExternalNetworkInUse(nexception.InUse):
     message = _("External network %(net_id)s cannot be updated to be made "
                 "non-external, since it has existing gateway ports")
 
index 7c63baa22a66d54e95f522dbad6bed8df8538211..d7968cdf86ef0dd2f587743a6075e5d9a3590158 100644 (file)
 
 
 from neutron.api.v2 import attributes as attr
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 
 
 # Extra Routes Exceptions
-class InvalidRoutes(qexception.InvalidInput):
+class InvalidRoutes(nexception.InvalidInput):
     message = _("Invalid format for routes: %(routes)s, %(reason)s")
 
 
-class RouterInterfaceInUseByRoute(qexception.InUse):
+class RouterInterfaceInUseByRoute(nexception.InUse):
     message = _("Router interface for subnet %(subnet_id)s on router "
                 "%(router_id)s cannot be deleted, as it is required "
                 "by one or more routes.")
 
 
-class RoutesExhausted(qexception.BadRequest):
+class RoutesExhausted(nexception.BadRequest):
     message = _("Unable to complete operation for %(router_id)s. "
                 "The number of routes exceeds the maximum %(quota)s.")
 
index d7cbb1f0a414d0795c0a72fbdefd09f703b9fe2c..4e76c9a4915dfd40abe1314b094bfcab9648e19c 100644 (file)
@@ -21,7 +21,7 @@ import six
 from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import resource_helper
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.services import service_base
@@ -31,28 +31,28 @@ LOG = logging.getLogger(__name__)
 
 
 # Firewall Exceptions
-class FirewallNotFound(qexception.NotFound):
+class FirewallNotFound(nexception.NotFound):
     message = _("Firewall %(firewall_id)s could not be found.")
 
 
-class FirewallInUse(qexception.InUse):
+class FirewallInUse(nexception.InUse):
     message = _("Firewall %(firewall_id)s is still active.")
 
 
-class FirewallInPendingState(qexception.Conflict):
+class FirewallInPendingState(nexception.Conflict):
     message = _("Operation cannot be performed since associated Firewall "
                 "%(firewall_id)s is in %(pending_state)s.")
 
 
-class FirewallPolicyNotFound(qexception.NotFound):
+class FirewallPolicyNotFound(nexception.NotFound):
     message = _("Firewall Policy %(firewall_policy_id)s could not be found.")
 
 
-class FirewallPolicyInUse(qexception.InUse):
+class FirewallPolicyInUse(nexception.InUse):
     message = _("Firewall Policy %(firewall_policy_id)s is being used.")
 
 
-class FirewallRuleSharingConflict(qexception.Conflict):
+class FirewallRuleSharingConflict(nexception.Conflict):
 
     """FWaaS exception for firewall rules
 
@@ -64,7 +64,7 @@ class FirewallRuleSharingConflict(qexception.Conflict):
                 "%(firewall_rule_id)s is not shared")
 
 
-class FirewallPolicySharingConflict(qexception.Conflict):
+class FirewallPolicySharingConflict(nexception.Conflict):
 
     """FWaaS exception for firewall policy
 
@@ -76,49 +76,49 @@ class FirewallPolicySharingConflict(qexception.Conflict):
                 "Rule %(firewall_rule_id)s")
 
 
-class FirewallRuleNotFound(qexception.NotFound):
+class FirewallRuleNotFound(nexception.NotFound):
     message = _("Firewall Rule %(firewall_rule_id)s could not be found.")
 
 
-class FirewallRuleInUse(qexception.InUse):
+class FirewallRuleInUse(nexception.InUse):
     message = _("Firewall Rule %(firewall_rule_id)s is being used.")
 
 
-class FirewallRuleNotAssociatedWithPolicy(qexception.InvalidInput):
+class FirewallRuleNotAssociatedWithPolicy(nexception.InvalidInput):
     message = _("Firewall Rule %(firewall_rule_id)s is not associated "
                 " with Firewall Policy %(firewall_policy_id)s.")
 
 
-class FirewallRuleInvalidProtocol(qexception.InvalidInput):
+class FirewallRuleInvalidProtocol(nexception.InvalidInput):
     message = _("Firewall Rule protocol %(protocol)s is not supported. "
                 "Only protocol values %(values)s and their integer "
                 "representation (0 to 255) are supported.")
 
 
-class FirewallRuleInvalidAction(qexception.InvalidInput):
+class FirewallRuleInvalidAction(nexception.InvalidInput):
     message = _("Firewall rule action %(action)s is not supported. "
                 "Only action values %(values)s are supported.")
 
 
-class FirewallRuleInvalidICMPParameter(qexception.InvalidInput):
+class FirewallRuleInvalidICMPParameter(nexception.InvalidInput):
     message = _("%(param)s are not allowed when protocol "
                 "is set to ICMP.")
 
 
-class FirewallRuleWithPortWithoutProtocolInvalid(qexception.InvalidInput):
+class FirewallRuleWithPortWithoutProtocolInvalid(nexception.InvalidInput):
     message = _("Source/destination port requires a protocol")
 
 
-class FirewallInvalidPortValue(qexception.InvalidInput):
+class FirewallInvalidPortValue(nexception.InvalidInput):
     message = _("Invalid value for port %(port)s.")
 
 
-class FirewallRuleInfoMissing(qexception.InvalidInput):
+class FirewallRuleInfoMissing(nexception.InvalidInput):
     message = _("Missing rule info argument for insert/remove "
                 "rule operation.")
 
 
-class FirewallInternalDriverError(qexception.NeutronException):
+class FirewallInternalDriverError(nexception.NeutronException):
     """Fwaas exception for all driver errors.
 
     On any failure or exception in the driver, driver should log it and
@@ -127,7 +127,7 @@ class FirewallInternalDriverError(qexception.NeutronException):
     message = _("%(driver)s: Internal driver error.")
 
 
-class FirewallRuleConflict(qexception.Conflict):
+class FirewallRuleConflict(nexception.Conflict):
 
     """Firewall rule conflict exception.
 
index e1106cda0115c830a358af68bbcffe67cf323e6a..5f1195c6ad27baafdd1c3edee311d85c9b25e5c6 100644 (file)
@@ -20,58 +20,58 @@ from oslo.config import cfg
 from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import resource_helper
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron.plugins.common import constants
 
 
 # L3 Exceptions
-class RouterNotFound(qexception.NotFound):
+class RouterNotFound(nexception.NotFound):
     message = _("Router %(router_id)s could not be found")
 
 
-class RouterInUse(qexception.InUse):
+class RouterInUse(nexception.InUse):
     message = _("Router %(router_id)s still has ports")
 
 
-class RouterInterfaceNotFound(qexception.NotFound):
+class RouterInterfaceNotFound(nexception.NotFound):
     message = _("Router %(router_id)s does not have "
                 "an interface with id %(port_id)s")
 
 
-class RouterInterfaceNotFoundForSubnet(qexception.NotFound):
+class RouterInterfaceNotFoundForSubnet(nexception.NotFound):
     message = _("Router %(router_id)s has no interface "
                 "on subnet %(subnet_id)s")
 
 
-class RouterInterfaceInUseByFloatingIP(qexception.InUse):
+class RouterInterfaceInUseByFloatingIP(nexception.InUse):
     message = _("Router interface for subnet %(subnet_id)s on router "
                 "%(router_id)s cannot be deleted, as it is required "
                 "by one or more floating IPs.")
 
 
-class FloatingIPNotFound(qexception.NotFound):
+class FloatingIPNotFound(nexception.NotFound):
     message = _("Floating IP %(floatingip_id)s could not be found")
 
 
-class ExternalGatewayForFloatingIPNotFound(qexception.NotFound):
+class ExternalGatewayForFloatingIPNotFound(nexception.NotFound):
     message = _("External network %(external_network_id)s is not reachable "
                 "from subnet %(subnet_id)s.  Therefore, cannot associate "
                 "Port %(port_id)s with a Floating IP.")
 
 
-class FloatingIPPortAlreadyAssociated(qexception.InUse):
+class FloatingIPPortAlreadyAssociated(nexception.InUse):
     message = _("Cannot associate floating IP %(floating_ip_address)s "
                 "(%(fip_id)s) with port %(port_id)s "
                 "using fixed IP %(fixed_ip)s, as that fixed IP already "
                 "has a floating IP on external network %(net_id)s.")
 
 
-class L3PortInUse(qexception.InUse):
+class L3PortInUse(nexception.InUse):
     message = _("Port %(port_id)s has owner %(device_owner)s and therefore"
                 " cannot be deleted directly via the port API.")
 
 
-class RouterExternalGatewayInUseByFloatingIp(qexception.InUse):
+class RouterExternalGatewayInUseByFloatingIp(nexception.InUse):
     message = _("Gateway cannot be updated for router %(router_id)s, since a "
                 "gateway to external network %(net_id)s is required by one or "
                 "more floating IPs.")
index 40ef4d9be508d3f3094bc109e470aa4b666dd664..54650cfd38ada89857a4270480bf9887f4821102 100644 (file)
@@ -22,74 +22,74 @@ from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import base
 from neutron.api.v2 import resource_helper
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron import manager
 from neutron.plugins.common import constants
 from neutron.services import service_base
 
 
 # Loadbalancer Exceptions
-class DelayOrTimeoutInvalid(qexception.BadRequest):
+class DelayOrTimeoutInvalid(nexception.BadRequest):
     message = _("Delay must be greater than or equal to timeout")
 
 
-class NoEligibleBackend(qexception.NotFound):
+class NoEligibleBackend(nexception.NotFound):
     message = _("No eligible backend for pool %(pool_id)s")
 
 
-class VipNotFound(qexception.NotFound):
+class VipNotFound(nexception.NotFound):
     message = _("Vip %(vip_id)s could not be found")
 
 
-class VipExists(qexception.NeutronException):
+class VipExists(nexception.NeutronException):
     message = _("Another Vip already exists for pool %(pool_id)s")
 
 
-class PoolNotFound(qexception.NotFound):
+class PoolNotFound(nexception.NotFound):
     message = _("Pool %(pool_id)s could not be found")
 
 
-class MemberNotFound(qexception.NotFound):
+class MemberNotFound(nexception.NotFound):
     message = _("Member %(member_id)s could not be found")
 
 
-class HealthMonitorNotFound(qexception.NotFound):
+class HealthMonitorNotFound(nexception.NotFound):
     message = _("Health_monitor %(monitor_id)s could not be found")
 
 
-class PoolMonitorAssociationNotFound(qexception.NotFound):
+class PoolMonitorAssociationNotFound(nexception.NotFound):
     message = _("Monitor %(monitor_id)s is not associated "
                 "with Pool %(pool_id)s")
 
 
-class PoolMonitorAssociationExists(qexception.Conflict):
+class PoolMonitorAssociationExists(nexception.Conflict):
     message = _('health_monitor %(monitor_id)s is already associated '
                 'with pool %(pool_id)s')
 
 
-class StateInvalid(qexception.NeutronException):
+class StateInvalid(nexception.NeutronException):
     message = _("Invalid state %(state)s of Loadbalancer resource %(id)s")
 
 
-class PoolInUse(qexception.InUse):
+class PoolInUse(nexception.InUse):
     message = _("Pool %(pool_id)s is still in use")
 
 
-class HealthMonitorInUse(qexception.InUse):
+class HealthMonitorInUse(nexception.InUse):
     message = _("Health monitor %(monitor_id)s still has associations with "
                 "pools")
 
 
-class PoolStatsNotFound(qexception.NotFound):
+class PoolStatsNotFound(nexception.NotFound):
     message = _("Statistics of Pool %(pool_id)s could not be found")
 
 
-class ProtocolMismatch(qexception.BadRequest):
+class ProtocolMismatch(nexception.BadRequest):
     message = _("Protocol %(vip_proto)s does not match "
                 "pool protocol %(pool_proto)s")
 
 
-class MemberExists(qexception.NeutronException):
+class MemberExists(nexception.NeutronException):
     message = _("Member with address %(address)s and port %(port)s "
                 "already present in pool %(pool)s")
 
index 8ecb5b6833a316e933804839f3bad5401b304779..79c9542191abbe519ad46f4ec177071c7dbbc068 100644 (file)
@@ -23,7 +23,7 @@ from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import base
 from neutron.api.v2 import resource_helper
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron import manager
 from neutron.plugins.common import constants
 from neutron.services import service_base
@@ -63,59 +63,59 @@ SUPPORTED_SP_TYPES = (SESSION_PERSISTENCE_SOURCE_IP,
 # Loadbalancer Exceptions
 # This exception is only for a workaround when having v1 and v2 lbaas extension
 # and plugins enabled
-class RequiredAttributeNotSpecified(qexception.BadRequest):
+class RequiredAttributeNotSpecified(nexception.BadRequest):
     message = _("Required attribute %(attr_name)s not specified")
 
 
-class EntityNotFound(qexception.NotFound):
+class EntityNotFound(nexception.NotFound):
     message = _("%(name)s %(id)s could not be found")
 
 
-class DelayOrTimeoutInvalid(qexception.BadRequest):
+class DelayOrTimeoutInvalid(nexception.BadRequest):
     message = _("Delay must be greater than or equal to timeout")
 
 
-class EntityInUse(qexception.InUse):
+class EntityInUse(nexception.InUse):
     message = _("%(entity_using)s %(id)s is using this %(entity_in_use)s")
 
 
-class LoadBalancerListenerProtocolPortExists(qexception.Conflict):
+class LoadBalancerListenerProtocolPortExists(nexception.Conflict):
     message = _("Load Balancer %(lb_id)s already has a listener with "
                 "protocol_port of %(protocol_port)s")
 
 
-class ListenerPoolProtocolMismatch(qexception.Conflict):
+class ListenerPoolProtocolMismatch(nexception.Conflict):
     message = _("Listener protocol %(listener_proto)s and pool protocol "
                 "%(pool_proto)s are not compatible.")
 
 
-class AttributeIDImmutable(qexception.NeutronException):
+class AttributeIDImmutable(nexception.NeutronException):
     message = _("Cannot change %(attribute)s if one already exists")
 
 
-class StateInvalid(qexception.NeutronException):
+class StateInvalid(nexception.NeutronException):
     message = _("Invalid state %(state)s of loadbalancer resource %(id)s")
 
 
-class MemberNotFoundForPool(qexception.NotFound):
+class MemberNotFoundForPool(nexception.NotFound):
     message = _("Member %(member_id)s could not be found in pool %(pool_id)s")
 
 
-class MemberExists(qexception.Conflict):
+class MemberExists(nexception.Conflict):
     message = _("Member with address %(address)s and protocol_port %(port)s "
                 "already present in pool %(pool)s")
 
 
-class MemberAddressTypeSubnetTypeMismatch(qexception.NeutronException):
+class MemberAddressTypeSubnetTypeMismatch(nexception.NeutronException):
     message = _("Member with address %(address)s and subnet %(subnet_id) "
                 " have mismatched IP versions")
 
 
-class DriverError(qexception.NeutronException):
+class DriverError(nexception.NeutronException):
     message = _("An error happened in the driver")
 
 
-class LBConfigurationUnsupported(qexception.NeutronException):
+class LBConfigurationUnsupported(nexception.NeutronException):
     message = _("Load balancer %(load_balancer_id)s configuration is not"
                 "supported by driver %(driver_name)s")
 
index 5be35a7d4a08d2f33f37520fa91724c737658d03..06536799983c2e064825cd9267989b6e8f608db3 100644 (file)
@@ -19,7 +19,7 @@ import six
 from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import resource_helper
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.services import service_base
@@ -27,19 +27,19 @@ from neutron.services import service_base
 LOG = logging.getLogger(__name__)
 
 
-class MeteringLabelNotFound(qexception.NotFound):
+class MeteringLabelNotFound(nexception.NotFound):
     message = _("Metering label %(label_id)s does not exist")
 
 
-class DuplicateMeteringRuleInPost(qexception.InUse):
+class DuplicateMeteringRuleInPost(nexception.InUse):
     message = _("Duplicate Metering Rule in POST.")
 
 
-class MeteringLabelRuleNotFound(qexception.NotFound):
+class MeteringLabelRuleNotFound(nexception.NotFound):
     message = _("Metering label rule %(rule_id)s does not exist")
 
 
-class MeteringLabelRuleOverlaps(qexception.Conflict):
+class MeteringLabelRuleOverlaps(nexception.Conflict):
     message = _("Metering label rule with remote_ip_prefix "
                 "%(remote_ip_prefix)s overlaps another")
 
index 5df48f63594183d948b00acc2730cda077b6f9b5..4fba23fbde04a7599ad58d57f9f6f72f3d40b998 100644 (file)
@@ -17,17 +17,17 @@ import webob.exc
 
 from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron.extensions import providernet as pnet
 
 SEGMENTS = 'segments'
 
 
-class SegmentsSetInConjunctionWithProviders(qexception.InvalidInput):
+class SegmentsSetInConjunctionWithProviders(nexception.InvalidInput):
     message = _("Segments and provider values cannot both be set.")
 
 
-class SegmentsContainDuplicateEntry(qexception.InvalidInput):
+class SegmentsContainDuplicateEntry(nexception.InvalidInput):
     message = _("Duplicate segment entry in request.")
 
 
index b652436ed8b767e818f84fdfbb068c001215c98b..68663f9e16cc042809e51954ecbb7e236ea68c14 100644 (file)
 #    under the License.
 
 from neutron.api.v2 import attributes
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 
 
-class PortSecurityPortHasSecurityGroup(qexception.InUse):
+class PortSecurityPortHasSecurityGroup(nexception.InUse):
     message = _("Port has security group associated. Cannot disable port "
                 "security or ip address until security group is removed")
 
 
-class PortSecurityAndIPRequiredForSecurityGroups(qexception.InvalidInput):
+class PortSecurityAndIPRequiredForSecurityGroups(nexception.InvalidInput):
     message = _("Port security must be enabled and port must have an IP"
                 " address in order to use security groups.")
 
 
-class PortSecurityBindingNotFound(qexception.InvalidExtensionEnv):
+class PortSecurityBindingNotFound(nexception.InvalidExtensionEnv):
     message = _("Port does not have port security binding.")
 
 PORTSECURITY = 'port_security_enabled'
index 61e2814837333e154b7116339d58e02cf880c90d..0934d65370c6dfd0fd0da1034910e0b1b11927aa 100644 (file)
@@ -23,90 +23,90 @@ from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import base
 from neutron.common import constants as const
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron import manager
 from neutron.openstack.common import uuidutils
 from neutron import quota
 
 
 # Security group Exceptions
-class SecurityGroupInvalidPortRange(qexception.InvalidInput):
+class SecurityGroupInvalidPortRange(nexception.InvalidInput):
     message = _("For TCP/UDP protocols, port_range_min must be "
                 "<= port_range_max")
 
 
-class SecurityGroupInvalidPortValue(qexception.InvalidInput):
+class SecurityGroupInvalidPortValue(nexception.InvalidInput):
     message = _("Invalid value for port %(port)s")
 
 
-class SecurityGroupInvalidIcmpValue(qexception.InvalidInput):
+class SecurityGroupInvalidIcmpValue(nexception.InvalidInput):
     message = _("Invalid value for ICMP %(field)s (%(attr)s) "
                 "%(value)s. It must be 0 to 255.")
 
 
-class SecurityGroupMissingIcmpType(qexception.InvalidInput):
+class SecurityGroupMissingIcmpType(nexception.InvalidInput):
     message = _("ICMP code (port-range-max) %(value)s is provided"
                 " but ICMP type (port-range-min) is missing.")
 
 
-class SecurityGroupInUse(qexception.InUse):
+class SecurityGroupInUse(nexception.InUse):
     message = _("Security Group %(id)s in use.")
 
 
-class SecurityGroupCannotRemoveDefault(qexception.InUse):
+class SecurityGroupCannotRemoveDefault(nexception.InUse):
     message = _("Insufficient rights for removing default security group.")
 
 
-class SecurityGroupCannotUpdateDefault(qexception.InUse):
+class SecurityGroupCannotUpdateDefault(nexception.InUse):
     message = _("Updating default security group not allowed.")
 
 
-class SecurityGroupDefaultAlreadyExists(qexception.InUse):
+class SecurityGroupDefaultAlreadyExists(nexception.InUse):
     message = _("Default security group already exists.")
 
 
-class SecurityGroupRuleInvalidProtocol(qexception.InvalidInput):
+class SecurityGroupRuleInvalidProtocol(nexception.InvalidInput):
     message = _("Security group rule protocol %(protocol)s not supported. "
                 "Only protocol values %(values)s and their integer "
                 "representation (0 to 255) are supported.")
 
 
-class SecurityGroupRulesNotSingleTenant(qexception.InvalidInput):
+class SecurityGroupRulesNotSingleTenant(nexception.InvalidInput):
     message = _("Multiple tenant_ids in bulk security group rule create"
                 " not allowed")
 
 
-class SecurityGroupRemoteGroupAndRemoteIpPrefix(qexception.InvalidInput):
+class SecurityGroupRemoteGroupAndRemoteIpPrefix(nexception.InvalidInput):
     message = _("Only remote_ip_prefix or remote_group_id may "
                 "be provided.")
 
 
-class SecurityGroupProtocolRequiredWithPorts(qexception.InvalidInput):
+class SecurityGroupProtocolRequiredWithPorts(nexception.InvalidInput):
     message = _("Must also specifiy protocol if port range is given.")
 
 
-class SecurityGroupNotSingleGroupRules(qexception.InvalidInput):
+class SecurityGroupNotSingleGroupRules(nexception.InvalidInput):
     message = _("Only allowed to update rules for "
                 "one security profile at a time")
 
 
-class SecurityGroupNotFound(qexception.NotFound):
+class SecurityGroupNotFound(nexception.NotFound):
     message = _("Security group %(id)s does not exist")
 
 
-class SecurityGroupRuleNotFound(qexception.NotFound):
+class SecurityGroupRuleNotFound(nexception.NotFound):
     message = _("Security group rule %(id)s does not exist")
 
 
-class DuplicateSecurityGroupRuleInPost(qexception.InUse):
+class DuplicateSecurityGroupRuleInPost(nexception.InUse):
     message = _("Duplicate Security Group Rule in POST.")
 
 
-class SecurityGroupRuleExists(qexception.InUse):
+class SecurityGroupRuleExists(nexception.InUse):
     message = _("Security group rule already exists. Rule id is %(id)s.")
 
 
-class SecurityGroupRuleParameterConflict(qexception.InvalidInput):
+class SecurityGroupRuleParameterConflict(nexception.InvalidInput):
     message = _("Conflicting value ethertype %(ethertype)s for CIDR %(cidr)s")
 
 
@@ -159,7 +159,7 @@ def convert_to_uuid_list_or_none(value_list):
     for sg_id in value_list:
         if not uuidutils.is_uuid_like(sg_id):
             msg = _("'%s' is not an integer or uuid") % sg_id
-            raise qexception.InvalidInput(error_message=msg)
+            raise nexception.InvalidInput(error_message=msg)
     return value_list
 
 
@@ -170,7 +170,7 @@ def convert_ip_prefix_to_cidr(ip_prefix):
         cidr = netaddr.IPNetwork(ip_prefix)
         return str(cidr)
     except (ValueError, TypeError, netaddr.AddrFormatError):
-        raise qexception.InvalidCIDR(input=ip_prefix)
+        raise nexception.InvalidCIDR(input=ip_prefix)
 
 
 def _validate_name_not_default(data, valid_values=None):
index fc32d2ace1f2176e9e2b2f95fb8f6d74e983d29c..22768249a2ed7c3328af6c6acebe2f8e8c2391e8 100644 (file)
@@ -20,74 +20,74 @@ import six
 from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import resource_helper
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron.plugins.common import constants
 from neutron.services import service_base
 
 
-class VPNServiceNotFound(qexception.NotFound):
+class VPNServiceNotFound(nexception.NotFound):
     message = _("VPNService %(vpnservice_id)s could not be found")
 
 
-class IPsecSiteConnectionNotFound(qexception.NotFound):
+class IPsecSiteConnectionNotFound(nexception.NotFound):
     message = _("ipsec_site_connection %(ipsec_site_conn_id)s not found")
 
 
-class IPsecSiteConnectionDpdIntervalValueError(qexception.InvalidInput):
+class IPsecSiteConnectionDpdIntervalValueError(nexception.InvalidInput):
     message = _("ipsec_site_connection %(attr)s is "
                 "equal to or less than dpd_interval")
 
 
-class IPsecSiteConnectionMtuError(qexception.InvalidInput):
+class IPsecSiteConnectionMtuError(nexception.InvalidInput):
     message = _("ipsec_site_connection MTU %(mtu)d is too small "
                 "for ipv%(version)s")
 
 
-class IKEPolicyNotFound(qexception.NotFound):
+class IKEPolicyNotFound(nexception.NotFound):
     message = _("IKEPolicy %(ikepolicy_id)s could not be found")
 
 
-class IPsecPolicyNotFound(qexception.NotFound):
+class IPsecPolicyNotFound(nexception.NotFound):
     message = _("IPsecPolicy %(ipsecpolicy_id)s could not be found")
 
 
-class IKEPolicyInUse(qexception.InUse):
+class IKEPolicyInUse(nexception.InUse):
     message = _("IKEPolicy %(ikepolicy_id)s is in use by existing "
                 "IPsecSiteConnection and can't be updated or deleted")
 
 
-class VPNServiceInUse(qexception.InUse):
+class VPNServiceInUse(nexception.InUse):
     message = _("VPNService %(vpnservice_id)s is still in use")
 
 
-class RouterInUseByVPNService(qexception.InUse):
+class RouterInUseByVPNService(nexception.InUse):
     message = _("Router %(router_id)s is used by VPNService %(vpnservice_id)s")
 
 
-class SubnetInUseByVPNService(qexception.InUse):
+class SubnetInUseByVPNService(nexception.InUse):
     message = _("Subnet %(subnet_id)s is used by VPNService %(vpnservice_id)s")
 
 
-class VPNStateInvalidToUpdate(qexception.BadRequest):
+class VPNStateInvalidToUpdate(nexception.BadRequest):
     message = _("Invalid state %(state)s of vpnaas resource %(id)s"
                 " for updating")
 
 
-class IPsecPolicyInUse(qexception.InUse):
+class IPsecPolicyInUse(nexception.InUse):
     message = _("IPsecPolicy %(ipsecpolicy_id)s is in use by existing "
                 "IPsecSiteConnection and can't be updated or deleted")
 
 
-class DeviceDriverImportError(qexception.NeutronException):
+class DeviceDriverImportError(nexception.NeutronException):
     message = _("Can not load driver :%(device_driver)s")
 
 
-class SubnetIsNotConnectedToRouter(qexception.BadRequest):
+class SubnetIsNotConnectedToRouter(nexception.BadRequest):
     message = _("Subnet %(subnet_id)s is not "
                 "connected to Router %(router_id)s")
 
 
-class RouterIsNotExternal(qexception.BadRequest):
+class RouterIsNotExternal(nexception.BadRequest):
     message = _("Router %(router_id)s has no external network gateway set")
 
 
index 9cabfde4b550e465daec9e617e0f6543a16df7ed..61e87d639f1e21eaa56e88ff264e91a85a5dc53e 100644 (file)
@@ -14,7 +14,7 @@
 #    under the License.
 
 from neutron.api.v2 import attributes as attr
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron.openstack.common import log as logging
 
 
@@ -22,11 +22,11 @@ LOG = logging.getLogger(__name__)
 
 
 # Router Rules Exceptions
-class InvalidRouterRules(qexception.InvalidInput):
+class InvalidRouterRules(nexception.InvalidInput):
     message = _("Invalid format for router rules: %(rule)s, %(reason)s")
 
 
-class RulesExhausted(qexception.BadRequest):
+class RulesExhausted(nexception.BadRequest):
     message = _("Unable to complete rules update for %(router_id)s. "
                 "The number of rules exceeds the maximum %(quota)s.")
 
@@ -46,7 +46,7 @@ def convert_to_valid_router_rules(data):
     if not isinstance(data, list):
         emsg = _("Invalid data format for router rule: '%s'") % data
         LOG.debug(emsg)
-        raise qexception.InvalidInput(error_message=emsg)
+        raise nexception.InvalidInput(error_message=emsg)
     _validate_uniquerules(data)
     rules = []
     expected_keys = ['source', 'destination', 'action']
@@ -66,7 +66,7 @@ def convert_to_valid_router_rules(data):
         errors = [m for m in errors if m]
         if errors:
             LOG.debug(errors)
-            raise qexception.InvalidInput(error_message=errors)
+            raise nexception.InvalidInput(error_message=errors)
         rules.append(rule)
     return rules
 
@@ -98,7 +98,7 @@ def _validate_uniquerules(rules):
     if len(set(pairs)) != len(pairs):
         error = _("Duplicate router rules (src,dst)  found '%s'") % pairs
         LOG.debug(error)
-        raise qexception.InvalidInput(error_message=error)
+        raise nexception.InvalidInput(error_message=error)
 
 
 class Routerrule(object):
index ecc12e0b20f716c66c690f71cbfddd2167559bb3..54cc64dccc474fdfa94ecb9ac18c8fc8ff6fa18a 100644 (file)
@@ -19,7 +19,7 @@ import abc
 from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import base
-from neutron.common import exceptions as qexception
+from neutron.common import exceptions as nexception
 from neutron import manager
 
 
@@ -30,42 +30,42 @@ qos_queue_get = "get_qos_queue"
 qos_queue_list = "get_qos_queues"
 
 
-class DefaultQueueCreateNotAdmin(qexception.InUse):
+class DefaultQueueCreateNotAdmin(nexception.InUse):
     message = _("Need to be admin in order to create queue called default")
 
 
-class DefaultQueueAlreadyExists(qexception.InUse):
+class DefaultQueueAlreadyExists(nexception.InUse):
     message = _("Default queue already exists.")
 
 
-class QueueInvalidDscp(qexception.InvalidInput):
+class QueueInvalidDscp(nexception.InvalidInput):
     message = _("Invalid value for dscp %(data)s must be integer value"
                 " between 0 and 63.")
 
 
-class QueueInvalidMarking(qexception.InvalidInput):
+class QueueInvalidMarking(nexception.InvalidInput):
     message = _("The qos marking cannot be set to 'trusted' "
                 "when the DSCP field is set")
 
 
-class QueueMinGreaterMax(qexception.InvalidInput):
+class QueueMinGreaterMax(nexception.InvalidInput):
     message = _("Invalid bandwidth rate, min greater than max.")
 
 
-class QueueInvalidBandwidth(qexception.InvalidInput):
+class QueueInvalidBandwidth(nexception.InvalidInput):
     message = _("Invalid bandwidth rate, %(data)s must be a non negative"
                 " integer.")
 
 
-class QueueNotFound(qexception.NotFound):
+class QueueNotFound(nexception.NotFound):
     message = _("Queue %(id)s does not exist")
 
 
-class QueueInUseByPort(qexception.InUse):
+class QueueInUseByPort(nexception.InUse):
     message = _("Unable to delete queue attached to port.")
 
 
-class QueuePortBindingNotFound(qexception.NotFound):
+class QueuePortBindingNotFound(nexception.NotFound):
     message = _("Port is not associated with lqueue")
 
 
@@ -78,7 +78,7 @@ def convert_to_unsigned_int_or_none(val):
             raise ValueError()
     except (ValueError, TypeError):
         msg = _("'%s' must be a non negative integer.") % val
-        raise qexception.InvalidInput(error_message=msg)
+        raise nexception.InvalidInput(error_message=msg)
     return val