+ # Determine local mgmt MAC address if host being added to secure
+ # pool so we can add default flows to allow management traffic
+ if new_controller and fail_mode_changed and pool_fail_mode == "secure":
+ oc = vswitchCfgQuery(["get", "Bridge", bridge, "other-config"])
+ m = re.match('.*hwaddr="([0-9a-fA-F:].*)".*', oc)
+ if m and m.group(1) in pool_mgmt_macs.keys():
+ mgmt_bridge = bridge
+ host_mgmt_mac = m.group(1)
+ host_mgmt_device = pool_mgmt_macs[host_mgmt_mac]
+
+ if host_mgmt_mac is not None and mgmt_bridge is not None and \
+ host_mgmt_device is not None:
+ tp = "idle_timeout=0,priority=0"
+ port = vswitchCfgQuery(["get", "interface", host_mgmt_device, "ofport"])
+ addFlow(mgmt_bridge, "%s,in_port=%s,arp,nw_proto=1,actions=local" % \
+ (tp, port))
+ addFlow(mgmt_bridge, "%s,in_port=local,arp,dl_src=%s,actions=%s" % \
+ (tp, host_mgmt_mac, port))
+ addFlow(mgmt_bridge, "%s,in_port=%s,dl_dst=%s,actions=local" % \
+ (tp, port, host_mgmt_mac))
+ addFlow(mgmt_bridge, "%s,in_port=local,dl_src=%s,actions=%s" % \
+ (tp, host_mgmt_mac, port))
+
+ if dib_changed:
+ ret_str += "Updated in-band management. "