summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/api/openstack/compute/contrib/coverage_ext.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/coverage_ext.py b/nova/api/openstack/compute/contrib/coverage_ext.py
index 50003bdab..154699470 100644
--- a/nova/api/openstack/compute/contrib/coverage_ext.py
+++ b/nova/api/openstack/compute/contrib/coverage_ext.py
@@ -42,7 +42,7 @@ CONF = cfg.CONF
class CoverageController(object):
"""The Coverage report API controller for the OpenStack API."""
def __init__(self):
- self.data_path = tempfile.mkdtemp(prefix='nova-coverage_')
+ self.data_path = None
self.services = []
self.combine = False
self._cover_inst = None
@@ -54,6 +54,8 @@ class CoverageController(object):
if not self._cover_inst:
try:
import coverage
+ if self.data_path is None:
+ self.data_path = tempfile.mkdtemp(prefix='nova-coverage_')
data_out = os.path.join(self.data_path, '.nova-coverage.api')
self._cover_inst = coverage.coverage(data_file=data_out)
except ImportError: