diff options
author | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-03-03 17:53:41 +0000 |
---|---|---|
committer | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-03-04 17:22:36 +0000 |
commit | 8813ab185d0b6ad1c111e7f9e346e2ce91c8113b (patch) | |
tree | 13d4ae5f62ade4142c8b23ea1738742d90db6519 /nova/exception.py | |
parent | d0cae6b5a16a5873afbcd47ba8ee5e97b6a25072 (diff) | |
download | nova-8813ab185d0b6ad1c111e7f9e346e2ce91c8113b.tar.gz nova-8813ab185d0b6ad1c111e7f9e346e2ce91c8113b.tar.xz nova-8813ab185d0b6ad1c111e7f9e346e2ce91c8113b.zip |
assertRaises(Exception, ...) considered harmful
Expecting that Exception is raised can end up passing an a test when an
unexpected error occurs. For instance, errors in the unit test itself
can be masked:
https://review.openstack.org/4848
https://review.openstack.org/4873
https://review.openstack.org/4874
Change a variety of unit tests to expect a more specific exception so
we don't run into false positive tests in the future.
Change-Id: Ibc0c63b1f6b5574a3ce93d9f02c9d1ff5ac4a8b0
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py index 43d16642f..f485e5ddf 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -554,6 +554,10 @@ class NetworkHostNotSet(NovaException): message = _("Host is not set to the network (%(network_id)s).") +class NetworkBusy(NovaException): + message = _("Network %(network)s has active ports, cannot delete.") + + class DatastoreNotFound(NotFound): message = _("Could not find the datastore reference(s) which the VM uses.") |