diff options
author | David Sommerseth <davids@redhat.com> | 2010-08-11 11:20:18 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2010-08-11 11:20:18 +0200 |
commit | a87c4f1938043b3fa1963ce7acbc22a0a7db7212 (patch) | |
tree | abd5f33d9a19d0e27985e568d2a7c0d348e68df5 | |
parent | dfc1b0627ea1d52d5a70c10bf03669665e5c99f5 (diff) | |
download | rteval-a87c4f1938043b3fa1963ce7acbc22a0a7db7212.tar.gz rteval-a87c4f1938043b3fa1963ce7acbc22a0a7db7212.tar.xz rteval-a87c4f1938043b3fa1963ce7acbc22a0a7db7212.zip |
Don't create log directories before it is needed
The directory called 'rteval-YYYYMMDD-#' and the 'logs' sub-directory
was created in the RtEval constructor. Moved this directory creation to
before the RtEval::measure() function was called to avoid creating empty
directories when using --summarize or --raw-histogram.
Signed-off-by: David Sommerseth <davids@redhat.com>
-rw-r--r-- | rteval/rteval.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/rteval/rteval.py b/rteval/rteval.py index 289d0cd..1eb6766 100644 --- a/rteval/rteval.py +++ b/rteval/rteval.py @@ -126,14 +126,6 @@ class RtEval(object): self.debug("workdir: %s" % self.workdir) - # create our report directory - try: - self.make_report_dir() - except: - print "Cannot create the report dir!" - print "(is this an NFS filesystem with rootsquash turned on?)" - sys.exit(-1) - # prepare a mailer, if that's configured if self.config.HasSection('smtp'): self.mailer = rtevalMailer.rtevalMailer(self.config.GetSection('smtp')) @@ -902,6 +894,14 @@ class RtEval(object): if not os.path.isdir(self.workdir): raise RuntimeError, "work directory %d does not exist" % self.workdir + # create our report directory + try: + self.make_report_dir() + except: + print "Cannot create the report dir!" + print "(is this an NFS filesystem with rootsquash turned on?)" + sys.exit(-1) + self.measure() # if --xmlrpc-submit | -X was given, send our report to this host |