[v2] framework/tester: fix pylama errors

Message ID 1638953699-8512-1-git-send-email-juraj.linkes@pantheon.tech (mailing list archive)
State Superseded
Headers
Series [v2] framework/tester: fix pylama errors |

Checks

Context Check Description
ci/Intel-dts-suite-test fail Testing issues

Commit Message

Juraj Linkeš Dec. 8, 2021, 8:54 a.m. UTC
Pylama found the following errors:
framework/tester.py:247: [E] E1136 Value 'self.duts' is unsubscriptable [pylint]
framework/tester.py:259: [E] E1133 Non-iterable value self.duts is used in an iterating context [pylint]
framework/tester.py:348: [E] E1101 Instance of 'Exception' has no 'message' member [pylint]
framework/tester.py:372: [E] E1101 Instance of 'Exception' has no 'message' member [pylint]

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
Lijuan, please add additional people to review if needed.
---
 framework/tester.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/framework/tester.py b/framework/tester.py
index 9dba4e4d..cb3d2015 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -85,7 +85,7 @@  class Tester(Crb):
         check_crb_python_version(self)
 
         self.bgProcIsRunning = False
-        self.duts = None
+        self.duts = []
         self.inBg = 0
         self.scapyCmds = []
         self.bgCmds = []
@@ -345,7 +345,7 @@  class Tester(Crb):
                     self.send_expect("ifconfig %s up" % itf, "# ")
 
         except Exception as e:
-            self.logger.error("   !!! Restore ITF: " + e.message)
+            self.logger.error(f"   !!! Restore ITF: {e}")
 
         sleep(2)
 
@@ -369,7 +369,7 @@  class Tester(Crb):
                     self.enable_ipv6(itf)
                     self.send_expect("ifconfig %s up" % itf, "# ")
         except Exception as e:
-            self.logger.error("   !!! Restore ITF: " + e.message)
+            self.logger.error(f"   !!! Restore ITF: {e}")
 
         sleep(2)