From: Thanh Ha Date: Mon, 16 Mar 2015 01:32:15 +0000 (-0400) Subject: Fix pep8 violations in csit/libraries/SwitchClasses/ProVision.py X-Git-Tag: release/helium-sr3~55^2~1 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=246581f55f24eb1fc96cbc1af7e35d7043d65218;p=integration%2Ftest.git Fix pep8 violations in csit/libraries/SwitchClasses/ProVision.py Change-Id: I15fbcb06264a6ee703600114705cf21efb2f2715 Signed-off-by: Thanh Ha --- diff --git a/test/csit/libraries/SwitchClasses/ProVision.py b/test/csit/libraries/SwitchClasses/ProVision.py index 7e977383c4..9b32c5f483 100644 --- a/test/csit/libraries/SwitchClasses/ProVision.py +++ b/test/csit/libraries/SwitchClasses/ProVision.py @@ -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 ProVision(BaseSwitch): ''' @@ -28,51 +26,46 @@ class ProVision(BaseSwitch): @property def connection_configs(self): - return \ - ['\rend \ - \rconfig \ - \rconsole local-terminal none \ - \rno page \ - \rend\r'] + return ['\rend \ + \rconfig \ + \rconsole local-terminal none \ + \rno page \ + \rend\r'] @property def initialization_cmds(self): - return \ - ['\rend\rboot system flash primary config odl_test_startup_config\r', \ - 'y', \ - 'n'] + return ['\rend\rboot system flash primary config odl_test_startup_config\r', + 'y', + 'n'] @property def cleanup_cmds(self): - return \ - ['end', \ - 'config', \ - 'no openflow\r \ - y'] + return ['end', + 'config', + 'no openflow\r' + 'y'] @property def base_openflow_config(self): - return \ - 'end', \ - 'config', \ - 'openflow', \ - 'controller-id ' + self.of_instance_id + ' ip ' + self.of_controller_ip + \ - ' controller-interface oobm', \ - 'instance ' + self.of_instance_id, \ - 'member vlan 10', \ - 'controller-id ' + self.of_instance_id + ' ', \ - 'version 1.3', \ - 'enable', \ - 'openflow enable', \ - 'end' + return 'end', \ + 'config', \ + 'openflow', \ + 'controller-id ' + self.of_instance_id + ' ip ' + self.of_controller_ip + \ + ' controller-interface oobm', \ + 'instance ' + self.of_instance_id, \ + 'member vlan 10', \ + 'controller-id ' + self.of_instance_id + ' ', \ + 'version 1.3', \ + 'enable', \ + 'openflow enable', \ + 'end' @property def openflow_enable_config(self): - return \ - ['end', \ - 'config', \ - 'openflow enable', \ - 'end'] + return ['end', + 'config', + 'openflow enable', + 'end'] @property def openflow_validation_cmd(self): @@ -81,38 +74,32 @@ class ProVision(BaseSwitch): @property def openflow_enable_validations(self): - return \ - ['OpenFlow +: Enabled', \ - self.of_instance_id + ' +Up +2 +1 +1.3'] + return ['OpenFlow +: Enabled', + self.of_instance_id + ' +Up +2 +1 +1.3'] @property def openflow_disable_config(self): - return \ - ['end', \ - 'config', \ - 'openflow disable', \ - 'end'] + return ['end', + 'config', + 'openflow disable', + 'end'] @property def openflow_disable_validations(self): - return \ - ['OpenFlow +: Disabled', \ - self.of_instance_id + ' +Down +0 +0 +1.3'] + return ['OpenFlow +: Disabled', self.of_instance_id + ' +Down +0 +0 +1.3'] @property def dump_all_flows(self): - return \ - 'show openflow instance ' + self.of_instance_id + ' flows' + return 'show openflow instance ' + self.of_instance_id + ' flows' @property def flow_validations(self): - return \ - ['(?ms)Flow Table ID : 0.*Flow Table ID : 100.*' + \ - 'Source Protocol Address : ' + self.ip_src + '.*' + \ - 'Target Protocol Address : ' + self.ip_dst + '.*' + \ - 'Flow Table ID : ' + self.table_id + '.*' + self.action, \ - 'Source MAC : ' + self.src_mac, \ - 'Destination MAC : ' + self.dst_mac] + return ['(?ms)Flow Table ID : 0.*Flow Table ID : 100.*' + + 'Source Protocol Address : ' + self.ip_src + '.*' + + 'Target Protocol Address : ' + self.ip_dst + '.*' + + 'Flow Table ID : ' + self.table_id + '.*' + self.action, + 'Source MAC : ' + self.src_mac, + 'Destination MAC : ' + self.dst_mac] def create_flow_match_elements(self, flow_xml): super(ProVision, self).create_flow_match_elements(flow_xml) @@ -159,9 +146,9 @@ class ProVision(BaseSwitch): if not self.datapath_id_output_string: self.datapath_id = 'unknown' else: - #Datapath ID : 000af0921c22bac0 - #|-----------------(0)---------------------| - #|-----------(1)----------| |------(2)-----| - matches = re.search('(.*: )(\w+)', self.datapath_id_output_string) - datapath_id_hex = matches.group(2) - self.datapath_id = self.convert_hex_to_decimal_as_string(datapath_id_hex) + # Datapath ID : 000af0921c22bac0 + # |-----------------(0)---------------------| + # |-----------(1)----------| |------(2)-----| + matches = re.search('(.*: )(\w+)', self.datapath_id_output_string) + datapath_id_hex = matches.group(2) + self.datapath_id = self.convert_hex_to_decimal_as_string(datapath_id_hex)