diff options
| author | Ethan Jackson <ethan@nicira.com> | 2011-01-24 10:54:17 -0800 |
|---|---|---|
| committer | Ethan Jackson <ethan@nicira.com> | 2011-01-24 11:25:53 -0800 |
| commit | 75fca0a445ccecbf0b53a44024800860475acf2e (patch) | |
| tree | 98f3438099fc9509d4671df3b206f86ffc1f2100 /xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | |
| parent | 2e9d1b61b32867cf1343b3f1865610606d83adf5 (diff) | |
| download | openvswitch-75fca0a445ccecbf0b53a44024800860475acf2e.tar.gz | |
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 <dtsai@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'xenserver/etc_xapi.d_plugins_openvswitch-cfg-update')
| -rwxr-xr-x | xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | 11 |
1 files 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 a4d97f58e..b5921f194 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('[]"') |
