From 75fca0a445ccecbf0b53a44024800860475acf2e Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Mon, 24 Jan 2011 10:54:17 -0800 Subject: [PATCH] xenserver: Change all bridge's fail_mode when updating. 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 Signed-off-by: Ethan Jackson --- xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update index a4d97f58..b5921f19 100755 --- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update +++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update @@ -92,15 +92,8 @@ def update(session, args): 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('[]"') -- 2.30.2