Fix pep8 violations in csit/libraries/SwitchManager.py
authorThanh Ha <thanh.ha@linuxfoundation.org>
Sun, 15 Mar 2015 21:33:29 +0000 (17:33 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Mar 2015 01:04:13 +0000 (21:04 -0400)
Change-Id: Ibbb0da108bb5447a37a9abf6cf41947f27fefd84
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
test/csit/libraries/SwitchManager.py

index c72c636ae2592ee14354f981696348f9fe7715dc..d0cab65006a97ceedd1a6428441113350f1d3f75 100644 (file)
@@ -3,9 +3,9 @@ Library for the robot based system test tool of the OpenDaylight project.
 Authors: Baohua Yang@IBM, Denghui Huang@IBM
 Updated: 2013-11-10
 """
-import robot
 from robot.libraries.BuiltIn import BuiltIn
 
+
 class SwitchManager(object):
     def __init__(self):
         self.builtin = BuiltIn()
@@ -14,17 +14,17 @@ class SwitchManager(object):
         """
         Return all nodes.
         """
-        if isinstance(content,dict) and content.has_key('nodeProperties'):
+        if isinstance(content, dict) and 'nodeProperties' in content:
             self.builtin.log("18")
             return [e.get('node') for e in content['nodeProperties']]
         else:
             self.builtin.log("21")
-            return None 
+            return None
 
     def extract_all_properties(self, content, property_type):
-        if isinstance(content,dict) and content.has_key(property_type):
+        if isinstance(content, dict) and property_type in content:
             self.builtin.log("26")
-            list1=[e.get('properties') for e in content[property_type]]
+            list1 = [e.get('properties') for e in content[property_type]]
             self.builtin.log(list1)
             return [e.get('properties') for e in content[property_type]]
         else: