# ovs-vswitchd configuration file that are managed in the xapi database
# when integrated with Citrix management tools.
-# Copyright (C) 2009 Nicira Networks, Inc.
+# Copyright (C) 2009, 2010 Nicira Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
return "No change to configuration"
def vswitchCurrentController():
- controller = vswitchCfgQuery("get Open_vSwitch . managers").strip('[]"')
+ controller = vswitchCfgQuery(["get", "Open_vSwitch",
+ ".", "managers"]).strip('[]"')
if controller == "":
return controller
if len(controller) < 4 or controller[0:4] != "ssl:":
"--", "set", "Open_vSwitch", ".",
'managers="ssl:' + controller + ':6632"'])
-def vswitchCfgQuery(action):
- cmd = [vsctl, "-vANY:console:emer", action]
+def vswitchCfgQuery(action_args):
+ cmd = [vsctl, "-vANY:console:emer"] + action_args
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
if len(output) == 0 or output[0] == None:
output = ""