2 Provision 3800 Object Definition
3 Authors: james.luhrsen@hp.com
7 from BaseSwitch import * # noqa
10 class H3C(BaseSwitch):
18 mgmt_protocol = 'telnet'
21 mgmt_prompt = '(' + model + '.*>|' + model + '.*])'
23 initialization_type = 'reboot'
29 def connection_configs(self):
33 def initialization_cmds(self):
34 return ['\rstartup saved-configuration odl_test_startup_config.cfg main\r',
42 def cleanup_cmds(self):
43 return ['system-view',
44 'undo openflow instance ' + self.of_instance_id,
48 def base_openflow_config(self):
49 return ['system-view',
50 'openflow instance ' + self.of_instance_id,
51 'classification vlan 1',
52 'controller ' + self.of_instance_id + ' address ip ' + self.of_controller_ip,
57 def openflow_enable_config(self):
58 return ['system-view',
59 'openflow instance ' + self.of_instance_id,
60 'classification vlan 1',
65 def openflow_validation_cmd(self):
66 return 'display openflow summary'
69 def openflow_enable_validations(self):
70 return [self.of_instance_id + ' +Active',
74 def openflow_disable_config(self):
75 return ['system-view',
76 'openflow instance ' + self.of_instance_id,
77 'undo classification',
82 def openflow_disable_validations(self):
83 return [self.of_instance_id + ' +Inactive - +- +- +- +-']
86 def dump_all_flows(self):
90 def datapath_id_output_command(self):
91 return 'display openflow summary | include 0x'
93 datapath_id_output_string = ''
96 def update_datapath_id(self):
97 if not self.datapath_id_output_string:
98 self.datapath_id = 'unknown'
100 # 21 Active 0x0015cc3e5f42ad23 Connected 1 24 N
101 # |---------------------------------(0)---------------------------------|
102 # |------(1)-------||------(2)-----|
103 matches = re.search('(.*0x)(\w+) +Connected', self.datapath_id_output_string)
104 datapath_id_hex = matches.group(2)
105 self.datapath_id = self.convert_hex_to_decimal_as_string(datapath_id_hex)