From: Ethan Jackson Date: Mon, 24 Jan 2011 18:54:17 +0000 (-0800) Subject: xenserver: Change all bridge's fail_mode when updating. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75fca0a445ccecbf0b53a44024800860475acf2e;p=openvswitch 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 --- 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('[]"')