summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/api/openstack/compute/contrib/coverage_ext.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/nova/api/openstack/compute/contrib/coverage_ext.py b/nova/api/openstack/compute/contrib/coverage_ext.py
index e151082a3..bafb6711e 100644
--- a/nova/api/openstack/compute/contrib/coverage_ext.py
+++ b/nova/api/openstack/compute/contrib/coverage_ext.py
@@ -118,14 +118,13 @@ class CoverageController(object):
return ports
def _start_coverage_telnet(self, tn, service):
+ data_file = os.path.join(self.data_path,
+ '.nova-coverage.%s' % str(service))
tn.write('import sys\n')
tn.write('from coverage import coverage\n')
- if self.combine:
- data_file = os.path.join(self.data_path,
- '.nova-coverage.%s' % str(service))
- tn.write("coverInst = coverage(data_file='%s')\n)" % data_file)
- else:
- tn.write('coverInst = coverage()\n')
+ tn.write("coverInst = coverage(data_file='%s') "
+ "if 'coverInst' not in locals() "
+ "else coverInst\n" % data_file)
tn.write('coverInst.skipModules = sys.modules.keys()\n')
tn.write("coverInst.start()\n")
tn.write("print 'finished'\n")