#! /usr/bin/python
#
-# Copyright (c) 2009 Nicira Networks.
+# Copyright (c) 2009, 2010 Nicira Networks.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
argv0 = sys.argv[0]
-BRCTL = "/usr/lib/vswitch/xs-original/brctl"
+BRCTL = "/usr/lib/openvswitch/xs-original/brctl"
VSCTL = "/usr/bin/ovs-vsctl"
-OVSDB_SERVER = "unix:/var/run/ovsdb-server"
+OVSDB_SERVER = "unix:/var/run/openvswitch/db.sock"
# Execute the real brctl program, passing the same arguments that were passed
# to us.
def call_vsctl(cmd, arg=""):
database = '--db=' + OVSDB_SERVER
- command = [VSCTL, database, cmd]
+ command = [VSCTL, '--timeout=30', database, cmd]
if (arg):
command.append(arg)
return subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0].split()
print "\t\t\t\t\t\t\t%s" % port
def main():
+ # Check the network configuration mode.
+ try:
+ network_mode = read_first_line_of_file('/etc/xensource/network.conf')
+ if network_mode == 'bridge':
+ delegate()
+ except:
+ # File probably doesn't exist
+ pass
+
# Parse the command line.
try:
options, args = getopt.gnu_getopt(sys.argv[1:],