2 Provision 3800 Object Definition
3 Authors: james.luhrsen@hp.com
7 from BaseSwitch import BaseSwitch
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):
35 "\rstartup saved-configuration odl_test_startup_config.cfg main\r",
44 def cleanup_cmds(self):
47 "undo openflow instance " + self.of_instance_id,
52 def base_openflow_config(self):
55 "openflow instance " + self.of_instance_id,
56 "classification vlan 1",
60 + self.of_controller_ip,
66 def openflow_enable_config(self):
69 "openflow instance " + self.of_instance_id,
70 "classification vlan 1",
76 def openflow_validation_cmd(self):
77 return "display openflow summary"
80 def openflow_enable_validations(self):
81 return [self.of_instance_id + " +Active", "Connected 1 24 N"]
84 def openflow_disable_config(self):
87 "openflow instance " + self.of_instance_id,
88 "undo classification",
94 def openflow_disable_validations(self):
95 return [self.of_instance_id + " +Inactive - +- +- +- +-"]
98 def dump_all_flows(self):
102 def datapath_id_output_command(self):
103 return "display openflow summary | include 0x"
105 datapath_id_output_string = ""
108 def update_datapath_id(self):
109 if not self.datapath_id_output_string:
110 self.datapath_id = "unknown"
112 # 21 Active 0x0015cc3e5f42ad23 Connected 1 24 N
113 # |---------------------------------(0)---------------------------------|
114 # |------(1)-------||------(2)-----|
116 "(.*0x)(\w+) +Connected", self.datapath_id_output_string
118 datapath_id_hex = matches.group(2)
119 self.datapath_id = self.convert_hex_to_decimal_as_string(datapath_id_hex)