Remove unused exceptions

There are four exceptions (TenantNetworksDisabled,
InvalidExtensionEnv, DvrHaRouterNotSupported,
MissingMinSubnetPoolPrefix) that are not used in Neutron, thus
unnecessary to have them in neutron/common/exceptions.py.

- TenantNetworksDisabled was added in [1] to Quantum, and was
  raised when the tenant network type was TYPE_NONE.
  It was used in the openvswitch and linuxbridge plugins in Quantum,
  but now there are no occurrences of usage.
  It is still used in the Neutron plugin of OpenContrail though,
  so complete removal may be inappropriate right now.

- InvalidExtensionEnv (previously InvalidExtenstionEnv, renamed in
  [2a]) was added in [2b] to Quantum. It was raised when the
  appropriate quota driver was not provided, thus the extension
  environment was invalid. The usage was removed in [2c].

- DvrHaRouterNotSupported was added in [3a], and was raised when the
  router was both DVR and HA (it was not supported by that time).
  The usage was removed in [3b].

- MissingMinSubnetPoolPrefix was added in [4]. I did not find any
  prior usage of this exception.

This patch removes the last three exceptions from exceptions.py,
and adds a note to the first about possible removal in the future.

[1]: https://review.openstack.org/#/c/12362/

[2a]: https://review.openstack.org/#/c/23902/
[2b]: https://review.openstack.org/#/c/10484/
[2c]: https://review.openstack.org/#/c/23406/

[3a]: https://review.openstack.org/#/c/143733/
[3b]: https://review.openstack.org/#/c/196893/

[4]: https://review.openstack.org/#/c/148698/

Change-Id: Id47044e1feea4aea0d375b922aea7bd6cc50ac08
This commit is contained in:
Viktor Varga 2017-07-05 17:36:52 +02:00
parent df762b0d46
commit 8e5128e27a

View File

@ -99,6 +99,8 @@ class FlatNetworkInUse(e.InUse):
class TenantNetworksDisabled(e.ServiceUnavailable):
# NOTE(vvargaszte): May be removed in the future as it is not used in
# Neutron, only in the Neutron plugin of OpenContrail.
message = _("Tenant network creation is not enabled.")
@ -172,10 +174,6 @@ class QoSRuleParameterConflict(e.Conflict):
"%(existing_value)s.")
class InvalidExtensionEnv(e.BadRequest):
message = _("Invalid extension environment: %(reason)s.")
class ExtensionsNotFound(e.NotFound):
message = _("Extensions not found: %(extensions)s.")
@ -234,10 +232,6 @@ class RouterNotCompatibleWithAgent(e.NeutronException):
message = _("Router '%(router_id)s' is not compatible with this agent.")
class DvrHaRouterNotSupported(e.NeutronException):
message = _("Router '%(router_id)s' cannot be both DVR and HA.")
class FailToDropPrivilegesExit(SystemExit):
"""Exit exception raised when a drop privileges action fails."""
code = 99
@ -264,10 +258,6 @@ class AbortSyncRouters(e.NeutronException):
message = _("Aborting periodic_sync_routers_task due to an error.")
class MissingMinSubnetPoolPrefix(e.BadRequest):
message = _("Unspecified minimum subnet pool prefix.")
class EmptySubnetPoolPrefixList(e.BadRequest):
message = _("Empty subnet pool prefix list.")