@@ -265,7 +265,7 @@ class Cyclictest(rtevalModulePrototype):
def _WorkloadPrepare(self):
- self.__interval = 'interval' in self.__cfg and '-i%d' % int(self.__cfg.interval) or ""
+ self.__interval = 'interval' in self.__cfg.keys() and '-i%d' % int(self.__cfg.interval) or ""
self.__cmd = ['cyclictest',
self.__interval,
@@ -280,10 +280,10 @@ class Cyclictest(rtevalModulePrototype):
self.__cmd.append('-t')
self.__cmd.append('-a')
- if 'threads' in self.__cfg and self.__cfg.threads:
+ if 'threads' in self.__cfg.keys() and self.__cfg.threads:
self.__cmd.append("-t%d" % int(self.__cfg.threads))
- if 'breaktrace' in self.__cfg and self.__cfg.breaktrace:
+ if 'breaktrace' in self.__cfg.keys() and self.__cfg.breaktrace:
self.__cmd.append("-b%d" % int(self.__cfg.breaktrace))
self.__cmd.append("--tracemark")
@@ -300,7 +300,7 @@ class Cyclictest(rtevalModulePrototype):
self.__nullfp = os.open('/dev/null', os.O_RDWR)
debugdir = self.__get_debugfs_mount()
- if 'breaktrace' in self.__cfg and self.__cfg.breaktrace and debugdir:
+ if 'breaktrace' in self.__cfg.keys() and self.__cfg.breaktrace and debugdir:
# Ensure that the trace log is clean
trace = os.path.join(debugdir, 'tracing', 'trace')
fp = open(os.path.join(trace), "w")
The self.__cfg itself is not a dictionary and "key in self.__cfg" does not work as expected. Use "key in self.__cfg.keys()" instead. This bug was introduced by the commit fd3b732f714d ("rteval: 2to3 transformations") Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp> --- rteval/modules/measurement/cyclictest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)