xenserver: Make openvswitch-cfg-update reset 'manager_options' column.
authorAndrew Evans <aevans@nicira.com>
Mon, 7 Feb 2011 22:41:09 +0000 (14:41 -0800)
committerAndrew Evans <aevans@nicira.com>
Tue, 8 Feb 2011 18:44:12 +0000 (10:44 -0800)
xenserver/etc_xapi.d_plugins_openvswitch-cfg-update

index 5189d0436c333a5f90b6f46e6c65b2811aff7676..721fe6476e56c2c6c9a7c6035d8c1c281502e230 100755 (executable)
@@ -128,8 +128,7 @@ def update(session, args):
         return "No change to configuration"
 
 def vswitchCurrentController():
-    controller = vswitchCfgQuery(["get", "Open_vSwitch", 
-                                  ".", "managers"]).strip('[]"')
+    controller = vswitchCfgQuery(["get-manager"])
     if controller == "":
         return controller
     if len(controller) < 4 or controller[0:4] != "ssl:":
@@ -138,20 +137,19 @@ def vswitchCurrentController():
         return controller.split(':')[1]
 
 def removeControllerCfg():
-    vswitchCfgMod(["--", "clear", "Open_vSwitch", ".", "managers",
+    vswitchCfgMod(["--", "del-manager",
                    "--", "del-ssl"])
 
 def setControllerCfg(controller):
     # /etc/xensource/xapi-ssl.pem is mentioned twice below because it
     # contains both the private key and the certificate.
-    vswitchCfgMod(["--", "clear", "Open_vSwitch", ".", "managers",
+    vswitchCfgMod(["--", "del-manager",
                    "--", "del-ssl",
                    "--", "--bootstrap", "set-ssl",
                    "/etc/xensource/xapi-ssl.pem",
                    "/etc/xensource/xapi-ssl.pem",
                    cacert_filename,
-                   "--", "set", "Open_vSwitch", ".",
-                   'managers="ssl:' + controller + ':6632"'])
+                   "--", "set-manager", 'ssl:' + controller + ':6632'])
 
 def vswitchCfgQuery(action_args):
     cmd = [vsctl, "--timeout=5", "-vANY:console:emer"] + action_args