diff options
author | David Sommerseth <davids@redhat.com> | 2013-01-14 14:21:23 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2013-01-14 14:21:23 +0100 |
commit | eae0031fba9782e3d768c9c3ee6b3a552f52f8f5 (patch) | |
tree | 05f439c9422dc3b543bda4aadd4dcfcc38e2dc59 /rteval | |
parent | 80609cb370b0de3c105c2855733aca86389a450e (diff) | |
download | rteval-eae0031fba9782e3d768c9c3ee6b3a552f52f8f5.tar.gz rteval-eae0031fba9782e3d768c9c3ee6b3a552f52f8f5.tar.xz rteval-eae0031fba9782e3d768c9c3ee6b3a552f52f8f5.zip |
Fix up type casting in the core module code
If rteval is used as a library, it would easily throw an exception
due to the wrong data type. This patch makes it a bit more flexible.
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'rteval')
-rw-r--r-- | rteval/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rteval/__init__.py b/rteval/__init__.py index a27dc35..4d4c4ab 100644 --- a/rteval/__init__.py +++ b/rteval/__init__.py @@ -149,7 +149,7 @@ class RtEval(rtevalReport): 'logging':self.__rtevcfg.logging, 'memsize':self._sysinfo.mem_get_size(), 'numanodes':self._sysinfo.mem_get_numa_nodes(), - 'duration':self.__rtevcfg.duration, + 'duration': float(self.__rtevcfg.duration), } self._loadmods.Setup(params) @@ -178,7 +178,7 @@ class RtEval(rtevalReport): print " with %d numa nodes" % self._sysinfo.mem_get_numa_nodes() else: print "" - print "Run duration: %d seconds" % self.__rtevcfg.duration + print "Run duration: %s seconds" % str(self.__rtevcfg.duration) # start the cyclictest thread measure_profile.Start() @@ -192,8 +192,8 @@ class RtEval(rtevalReport): # wait for time to expire or thread to die signal.signal(signal.SIGINT, sig_handler) signal.signal(signal.SIGTERM, sig_handler) - self.__logger.log(Log.INFO, "waiting for duration (%f)" % self.__rtevcfg.duration) - stoptime = (time.time() + self.__rtevcfg.duration) + self.__logger.log(Log.INFO, "waiting for duration (%s)" % str(self.__rtevcfg.duration)) + stoptime = (time.time() + float(self.__rtevcfg.duration)) currtime = time.time() rpttime = currtime + report_interval load_avg_checked = 5 |