The ovs plugin's update command was only setting fail_mode for
bridges attached to pifs. This patch applies the fail_mode
setting to all bridges on the XenServer system.
Reported-by: David Tsai <dtsai@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
fail_mode = 'standalone'
fail_mode_changed = False
- for (p, rec) in session.xenapi.PIF.get_all_records().items():
- try:
- network = session.xenapi.network.get_record(rec['network'])
- bridge = network['bridge']
- except Exception, e:
- syslog.syslog("%s: failed to get bridge name (%s)" %
- (script, str(e)))
- continue
-
+ for bridge in vswitchCfgQuery(['list-br']).split():
+ bridge = vswitchCfgQuery(['br-to-parent', bridge])
bridge_fail_mode = vswitchCfgQuery(["get", "Bridge",
bridge, "fail_mode"]).strip('[]"')