X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xenserver%2Fopt_xensource_libexec_InterfaceReconfigureVswitch.py;h=9e069f306be5051cd429e712c24f4e2c35589597;hb=ea7bd5973fb426f3a6ea66b0953c6000980e77ec;hp=8429358729479953e2778b07c3e984e76daad823;hpb=939e5a1bbf47d2dc7ec5665906c441f6569ce9e0;p=openvswitch diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index 84293587..9e069f30 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -332,10 +332,21 @@ def configure_datapath(pif): 'other-config:hwaddr=%s' % vsctl_escape(db().get_pif_record(pif)['MAC'])] pool = db().get_pool_record() - fail_mode = pool['other_config']['vswitch-controller-fail-mode'] + network = db().get_network_by_bridge(bridge) + fail_mode = None + valid_fail_modes = ['standalone', 'secure'] - if fail_mode in ['standalone', 'secure']: - vsctl_argv += ['--', 'set', 'Bridge', bridge, 'fail_mode=%s' % fail_mode] + if network: + network_rec = db().get_network_record(network) + fail_mode = network_rec['other_config'].get('vswitch-controller-fail-mode') + + if (fail_mode not in valid_fail_modes) and pool: + fail_mode = pool['other_config'].get('vswitch-controller-fail-mode') + + if fail_mode not in valid_fail_modes: + fail_mode = 'standalone' + + vsctl_argv += ['--', 'set', 'Bridge', bridge, 'fail_mode=%s' % fail_mode] vsctl_argv += set_br_external_ids(pif) vsctl_argv += ['## done configuring datapath %s' % bridge]