| To: | pcp developers <pcp@xxxxxxxxxxx> |
|---|---|
| Subject: | pmrep: properly close pmi log |
| From: | Marko Myllynen <myllynen@xxxxxxxxxx> |
| Date: | Tue, 15 Dec 2015 16:06:10 +0200 |
| Delivered-to: | pcp@xxxxxxxxxxx |
| Organization: | Red Hat |
| Reply-to: | myllynen@xxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
This was handled internally e.g. in case of Ctrl-C but let's make this
explicit now that we added the finalize() method earlier.
---
src/pmrep/pmrep.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/pmrep/pmrep.py b/src/pmrep/pmrep.py
index 60952ae..30d9f91 100644
--- a/src/pmrep/pmrep.py
+++ b/src/pmrep/pmrep.py
@@ -1160,6 +1160,7 @@ class PMReporter(object):
if timestamp == None and values == None:
# Complete and close
self.log.pmiEnd()
+ self.log = None
return
if self.log == None:
@@ -1422,6 +1423,9 @@ class PMReporter(object):
def finalize(self):
""" Finalize and clean up """
+ if self.log:
+ self.log.pmiEnd()
+ self.log = None
if self.wb:
self.wb.close()
self.wb = None
Thanks,
--
Marko Myllynen
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | pmrep: add xlsx support, Marko Myllynen |
|---|---|
| Next by Date: | pmrep: handle multiple instances with pmi, Marko Myllynen |
| Previous by Thread: | pmrep: add xlsx support, Marko Myllynen |
| Next by Thread: | Re: pmrep: properly close pmi log, Marko Myllynen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |