Fix pep8 violations in csit/libraries/SwitchClasses/H3C.py 64/16564/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Mar 2015 01:42:12 +0000 (21:42 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Mar 2015 01:42:12 +0000 (21:42 -0400)
Change-Id: Ib07f519cbd1efe5f30f424e4851ece91880bbfc3
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
test/csit/libraries/SwitchClasses/H3C.py

index 4dc3421df69471704896ed32d0530817a02e48ad..71de6d1318deb6e3dd1f1f4ea9f765ef37ef251f 100644 (file)
@@ -3,11 +3,9 @@ Provision 3800 Object Definition
 Authors: james.luhrsen@hp.com
 Created: 2014-10-02
 """
-import string
-import robot
 import re
-from robot.libraries.BuiltIn import BuiltIn
-from BaseSwitch import *
+from BaseSwitch import *  # noqa
+
 
 class H3C(BaseSwitch):
     '''
@@ -22,7 +20,6 @@ class H3C(BaseSwitch):
     mgmt_port = ''
     mgmt_prompt = '(' + model + '.*>|' + model + '.*])'
 
-
     initialization_type = 'reboot'
 
     of_controller_ip = ''
@@ -30,79 +27,68 @@ class H3C(BaseSwitch):
 
     @property
     def connection_configs(self):
-        return \
-            ['\r\r\r']
+        return ['\r\r\r']
 
     @property
     def initialization_cmds(self):
-        return \
-            ['\rstartup saved-configuration odl_test_startup_config.cfg main\r', \
-             'reboot\r', \
-             'Y\r', \
-             '\r', \
-             'N\r', \
-             'Y\r']
+        return ['\rstartup saved-configuration odl_test_startup_config.cfg main\r',
+                'reboot\r',
+                'Y\r',
+                '\r',
+                'N\r',
+                'Y\r']
 
     @property
     def cleanup_cmds(self):
-        return \
-            ['system-view', \
-             'undo openflow instance ' + self.of_instance_id, \
-             'return']
+        return ['system-view',
+                'undo openflow instance ' + self.of_instance_id,
+                'return']
 
     @property
     def base_openflow_config(self):
-        return \
-            ['system-view', \
-             'openflow instance ' + self.of_instance_id, \
-             'classification vlan 1', \
-             'controller ' + self.of_instance_id + ' address ip ' + self.of_controller_ip, \
-             'active instance', \
-             'return']
+        return ['system-view',
+                'openflow instance ' + self.of_instance_id,
+                'classification vlan 1',
+                'controller ' + self.of_instance_id + ' address ip ' + self.of_controller_ip,
+                'active instance',
+                'return']
 
     @property
     def openflow_enable_config(self):
-        return \
-            ['system-view', \
-             'openflow instance ' + self.of_instance_id, \
-             'classification vlan 1', \
-             'active instance', \
-             'return']
+        return ['system-view',
+                'openflow instance ' + self.of_instance_id,
+                'classification vlan 1',
+                'active instance',
+                'return']
 
     @property
     def openflow_validation_cmd(self):
-        return \
-            'display openflow summary'
+        return 'display openflow summary'
 
     @property
     def openflow_enable_validations(self):
-        return \
-            [self.of_instance_id + ' +Active', \
-             'Connected   1          24        N']
+        return [self.of_instance_id + ' +Active',
+                'Connected   1          24        N']
 
     @property
     def openflow_disable_config(self):
-        return \
-            ['system-view', \
-             'openflow instance ' + self.of_instance_id, \
-             'undo classification', \
-             'active instance', \
-             'return']
+        return ['system-view',
+                'openflow instance ' + self.of_instance_id,
+                'undo classification',
+                'active instance',
+                'return']
 
     @property
     def openflow_disable_validations(self):
-        return \
-            [self.of_instance_id + ' +Inactive  - +- +- +- +-']
+        return [self.of_instance_id + ' +Inactive  - +- +- +- +-']
 
     @property
     def dump_all_flows(self):
-        return \
-            ['']
+        return ['']
 
     @property
     def datapath_id_output_command(self):
-        return \
-            'display openflow summary | include 0x'
+        return 'display openflow summary | include 0x'
 
     datapath_id_output_string = ''
     datapath_id = ''
@@ -111,9 +97,9 @@ class H3C(BaseSwitch):
         if not self.datapath_id_output_string:
             self.datapath_id = 'unknown'
         else:
-         #21    Active    0x0015cc3e5f42ad23  Connected   1          24        N
-         #|---------------------------------(0)---------------------------------|
-         #|------(1)-------||------(2)-----|
-         matches = re.search('(.*0x)(\w+) +Connected', self.datapath_id_output_string)
-         datapath_id_hex = matches.group(2)
-         self.datapath_id = self.convert_hex_to_decimal_as_string(datapath_id_hex)
+            # 21    Active    0x0015cc3e5f42ad23  Connected   1          24        N
+            # |---------------------------------(0)---------------------------------|
+            # |------(1)-------||------(2)-----|
+            matches = re.search('(.*0x)(\w+) +Connected', self.datapath_id_output_string)
+            datapath_id_hex = matches.group(2)
+            self.datapath_id = self.convert_hex_to_decimal_as_string(datapath_id_hex)