logger -t scripts-vif "Adding ${vif} to ${bridge} with address ${address}"
vid=
- if [ -e "/etc/openvswitch/br-$bridge" ]; then
- . "/etc/openvswitch/br-$bridge"
+ if [ -e "/var/lib/openvswitch/br-$bridge" ]; then
+ . "/var/lib/openvswitch/br-$bridge"
if [ -n "$VLAN_SLAVE" -a -n "$VLAN_VID" ]; then
bridge=$VLAN_SLAVE
vid="--add=vlan.$vif.tag=$VLAN_VID"
db = None
management_pif = None
-dbcache_file = "/etc/ovs-vswitch.dbcache"
-vswitch_config_dir = "/etc/openvswitch"
+vswitch_state_dir = "/var/lib/openvswitch/"
+dbcache_file = vswitch_state_dir + "dbcache"
class Usage(Exception):
def __init__(self, msg):
# /etc/xensource/scripts/vif needs to know where to add VIFs.
if vlan_slave:
- if not os.path.exists(vswitch_config_dir):
- os.mkdir(vswitch_config_dir)
- br = ConfigurationFile("br-%s" % bridge, vswitch_config_dir)
+ if not os.path.exists(vswitch_state_dir):
+ os.mkdir(vswitch_state_dir)
+ br = ConfigurationFile("br-%s" % bridge, vswitch_state_dir)
br.write("VLAN_SLAVE=%s\n" % datapath)
br.write("VLAN_VID=%s\n" % pifrec['VLAN'])
br.close()
argv += ['--add=iface.%s.fake-bridge=true' % (ipdev)]
else:
try:
- os.unlink("%s/br-%s" % (vswitch_config_dir, bridge))
+ os.unlink("%s/br-%s" % (vswitch_state_dir, bridge))
except OSError:
pass
argv += ['--del-match=bridge.%s.xs-network-uuids=*' % datapath]