diff options
author | Ben Pfaff <blp@nicira.com> | 2010-03-23 09:40:26 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-03-23 09:40:26 -0700 |
commit | 7e67d10d501074d02a0a00f8ecabbba10796c0f8 (patch) | |
tree | c59d13a8b5aa8a5df62ce37a810b4fa19ed0fc3c | |
parent | 973eab3214382ece42f9e0a376b2352648c57202 (diff) |
xenserver: Fix "ovs-vsctl get" call in vswitch-cfg-update.
The ovs-vsctl arguments were being passed as a single string instead of
broken up as if the shell had performed word splitting. This fixes the
problem.
Without this commit, "unknown command 'get Open_vSwitch . managers';
use --help for help" appears in the system log. Adding the commit
suppresses that message.
NIC-72.
Reported-by: Andy Southgate <andy.southgate@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
-rwxr-xr-x | xenserver/etc_xapi.d_plugins_vswitch-cfg-update | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xenserver/etc_xapi.d_plugins_vswitch-cfg-update b/xenserver/etc_xapi.d_plugins_vswitch-cfg-update index 4cebe85c..4cf2d881 100755 --- a/xenserver/etc_xapi.d_plugins_vswitch-cfg-update +++ b/xenserver/etc_xapi.d_plugins_vswitch-cfg-update @@ -4,7 +4,7 @@ # 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. @@ -62,7 +62,8 @@ def update(session, args): 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:": @@ -84,8 +85,8 @@ def setControllerCfg(controller): "--", "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 = "" |