ofproto: Bundle all controller-related settings into a struct.
[openvswitch] / xenserver / etc_xapi.d_plugins_openvswitch-cfg-update
index 27aeaf624f2de58be8e761de5ba7dcdc0240f34d..42bd09a195772a06c3c524d46067397b0d5e961d 100755 (executable)
@@ -47,7 +47,12 @@ def update(session, args):
         raise XenAPIPlugin.Failure("MORE_THAN_ONE_POOL_FOR_HOST", [])
     pool = session.xenapi.pool.get_record(pools[0])
     try:
-        controller = pool["other_config"]["vSwitchController"]
+        try:
+            controller = pool["vswitch_controller"]
+        except KeyError:
+            # On systems older than XenServer 5.6.0, we needed to store
+            # the key in "other_config".
+            controller = pool["other_config"]["vSwitchController"]
     except KeyError, e:
         controller = ""
     currentController = vswitchCurrentController()