diff options
| author | Yang Yu <yuyangbj@cn.ibm.com> | 2013-04-17 18:11:02 +0800 |
|---|---|---|
| committer | Yang Yu <yuyangbj@cn.ibm.com> | 2013-05-03 14:33:16 +0800 |
| commit | b6e072a84a31eca1f7d7c44117327c5042e153c2 (patch) | |
| tree | 4d2bcb5f6dc129e31aa277c067400801cfef99f2 /nova/api | |
| parent | 8bb1cc2f82b0d1dcfb08777537584e5f574ae439 (diff) | |
| download | nova-b6e072a84a31eca1f7d7c44117327c5042e153c2.tar.gz nova-b6e072a84a31eca1f7d7c44117327c5042e153c2.tar.xz nova-b6e072a84a31eca1f7d7c44117327c5042e153c2.zip | |
nova coverage creates lots of empty folders
With nova coverage extension disabled as a default behaviour,
nova will create lots of empty folders under /tmp folder. And also
with each time the nova service reboot, it will create a new
directory with name like nova_coverage_*. There will be number of
the empty folders accumulated.
Patch-Set 3: Rebase for merging code
Fixes: bug 1169005
Change-Id: I26d1037eb66d781ac6ef6b600cca04a709bff3f7
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/coverage_ext.py | 4 |
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: |
