+ elif pif_is_tunnel(pif):
+ datapath_configure_tunnel(pif)
+
+ vsctl_argv += ['# configure Bridge MAC']
+ vsctl_argv += ['--', 'set', 'Bridge', bridge,
+ 'other-config:hwaddr=%s' % vsctl_escape(db().get_pif_record(pif)['MAC'])]
+
+ pool = db().get_pool_record()
+ network = db().get_network_by_bridge(bridge)
+ network_rec = None
+ fail_mode = None
+ valid_fail_modes = ['standalone', 'secure']
+
+ 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]
+
+ if network_rec:
+ dib = network_rec['other_config'].get('vswitch-disable-in-band')
+ if not dib:
+ vsctl_argv += ['--', 'remove', 'Bridge', bridge, 'other_config', 'disable-in-band']
+ elif dib in ['true', 'false']:
+ vsctl_argv += ['--', 'set', 'Bridge', bridge, 'other_config:disable-in-band=' + dib]
+ else:
+ log('"' + dib + '"' "isn't a valid setting for other_config:disable-in-band on " + bridge)
+
+ vsctl_argv += set_br_external_ids(pif)
+ vsctl_argv += ['## done configuring datapath %s' % bridge]