Fix error module usage
Failures of gate-ceilometer-dsvm-tempest-plugin in some patchs occur:
Traceback (most recent call last):
File "tempest/test.py", line 99, in wrapper
return f(self, *func_args, **func_kwargs)
File "/opt/stack/new/ceilometer/ceilometer/tests/tempest/api/test_telemetry_notification_api.py", line 52, in test_check_glance_v2_notifications
self.await_samples(metric, query)
File "/opt/stack/new/ceilometer/ceilometer/tests/tempest/api/base.py", line 131, in await_samples
raise exceptions.TimeoutException(
AttributeError: 'module' object has no attribute 'TimeoutException'
It is caused by the inappropriate usage of exceptions module. Let's fix it.
Change-Id: I66ea550ce4255ca6b0a645a119faac0021fb2041
diff --git a/ceilometer/tests/tempest/api/base.py b/ceilometer/tests/tempest/api/base.py
index d19e025..03e9acd 100644
--- a/ceilometer/tests/tempest/api/base.py
+++ b/ceilometer/tests/tempest/api/base.py
@@ -16,7 +16,6 @@
from tempest.common import compute
from tempest.common.utils import data_utils
from tempest import config
-from tempest import exceptions
from tempest.lib import exceptions as lib_exc
import tempest.test
@@ -128,7 +127,7 @@
return body
time.sleep(CONF.compute.build_interval)
- raise exceptions.TimeoutException(
+ raise lib_exc.TimeoutException(
'Sample for metric:%s with query:%s has not been added to the '
'database within %d seconds' % (metric, query,
CONF.compute.build_timeout))