Skip to contentSkip to conversation

kvm_stat profiler: Format exception to string

PATCH New Lucas Meneghel Rodrigues 1 participant 1 message Jan 17, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm_stat profiler: Format exception to string

There's a small mistake on the kvm_stat profiler:
The contents of the exception message were not
converted to a string before checking if the
problem was due to debugfs not mounted. Let's
fix that.

---
 client/profilers/kvm_stat/kvm_stat.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
client/profilers/kvm_stat/kvm_stat.py +2 -2
index 8180868..7568a03 100644
@@ -25,11 +25,11 @@ class kvm_stat(profiler.profiler):
         try:
             utils.system_output("%s --batch" % self.stat_path)
         except error.CmdError, e:
-            if 'debugfs' in e:
+            if 'debugfs' in str(e):
                 utils.system('mount -t debugfs debugfs /sys/kernel/debug')
             else:
                 raise error.AutotestError('kvm_stat failed due to an '
-                                          'unknown reason: %s' % e)
+                                          'unknown reason: %s' % str(e))
 
 
     def start(self, test):
Signature · 1 line
1.6.5.2