X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xenserver%2Fetc_xapi.d_plugins_openvswitch-cfg-update;h=42bd09a195772a06c3c524d46067397b0d5e961d;hb=79c9f2ee7883b52860c76c3730725f5731402874;hp=f915b422d0a4bebee2f60139890eef2a362fb0b9;hpb=88b56f290a776da698633db8a4457a506600688a;p=openvswitch diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update index f915b422..42bd09a1 100755 --- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update +++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update @@ -25,6 +25,7 @@ import XenAPIPlugin import XenAPI import os import subprocess +import syslog vsctl="/usr/bin/ovs-vsctl" cacert_filename="/etc/openvswitch/vswitchd.cacert" @@ -46,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() @@ -102,6 +108,13 @@ def vswitchCfgMod(action_args): if exitcode != 0: raise XenAPIPlugin.Failure("VSWITCH_CONFIG_MOD_FAILURE", [ str(exitcode) , str(action_args) ]) + +def emergency_reset(session, args): + # This function is just a place holder for testing until the real + # functionality is implemented. + syslog.syslog("openvswitch-cfg-update: emergency_reset called") + return "Need to implement emergency_reset" if __name__ == "__main__": - XenAPIPlugin.dispatch({"update": update}) + XenAPIPlugin.dispatch({"update": update, + "emergency_reset": emergency_reset})