aboutsummaryrefslogtreecommitdiff
path: root/xenserver
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2009-09-30 11:57:21 +0100
committerBen Pfaff <blp@nicira.com>2009-09-30 12:18:26 -0700
commit5990cd46192920da5faedde84b6123b854ec0555 (patch)
tree8b4972f89f5dd12e1f787c0bcfc2b6a95e63750e /xenserver
parented7cd1f8c429b28ca3d7874d2844ab7d1edb80bb (diff)
Drop separate vswitch-cfg-update.log.
xapi will log any error returned by the plugin.
Diffstat (limited to 'xenserver')
-rwxr-xr-xxenserver/etc_xapi.d_plugins_vswitch-cfg-update18
1 files changed, 1 insertions, 17 deletions
diff --git a/xenserver/etc_xapi.d_plugins_vswitch-cfg-update b/xenserver/etc_xapi.d_plugins_vswitch-cfg-update
index 536a2f32..7472d1b4 100755
--- a/xenserver/etc_xapi.d_plugins_vswitch-cfg-update
+++ b/xenserver/etc_xapi.d_plugins_vswitch-cfg-update
@@ -21,10 +21,6 @@
# TBD: - error handling needs to be improved. Currently this can leave
# TBD: the system in a bad state if anything goes wrong.
-import logging
-log = logging.getLogger("vswitch-cfg-update")
-logging.basicConfig(filename="/var/log/vswitch-cfg-update.log", level=logging.DEBUG)
-
import XenAPIPlugin
import XenAPI
import os
@@ -46,10 +42,8 @@ def update(session, args):
pools = session.xenapi.pool.get_all()
# We assume there is only ever one pool...
if len(pools) == 0:
- log.error("No pool for host.")
raise XenAPIPlugin.Failure("NO_POOL_FOR_HOST", [])
if len(pools) > 1:
- log.error("More than one pool for host.")
raise XenAPIPlugin.Failure("MORE_THAN_ONE_POOL_FOR_HOST", [])
pool = session.xenapi.pool.get_record(pools[0])
try:
@@ -58,28 +52,21 @@ def update(session, args):
controller = ""
currentController = vswitchCurrentController()
if controller == "" and currentController != "":
- log.debug("Removing controller configuration.")
delete_cacert()
removeControllerCfg()
return "Successfully removed controller config"
elif controller != currentController:
- if len(controller) == 0:
- log.debug("Setting controller to: %s" % (controller))
- else:
- log.debug("Changing controller from %s to %s" % (currentController, controller))
delete_cacert()
setControllerCfg(controller)
return "Successfully set controller to " + controller
else:
- log.debug("No change to controller configuration required.")
- return "No change to configuration"
+ return "No change to configuration"
def vswitchCurrentController():
controller = vswitchCfgQuery("mgmt.controller")
if controller == "":
return controller
if len(controller) < 4 or controller[0:4] != "ssl:":
- log.warning("Controller does not specify ssl connection type, returning entire string.")
return controller
else:
return controller[4:]
@@ -117,8 +104,6 @@ def vswitchCfgMod(action_args):
"--config-file=" + vswitchd_cfg_filename] + action_args
exitcode = subprocess.call(cmd)
if exitcode != 0:
- log.error("ovs-cfg-mod failed with exit code "
- + str(exitcode) + " for " + repr(action_args))
raise XenAPIPlugin.Failure("VSWITCH_CONFIG_MOD_FAILURE",
[ str(exitcode) , str(action_args) ])
vswitchReload()
@@ -126,7 +111,6 @@ def vswitchCfgMod(action_args):
def vswitchReload():
exitcode = subprocess.call(["/sbin/service", "vswitch", "reload"])
if exitcode != 0:
- log.error("vswitch reload failed with exit code " + str(exitcode))
raise XenAPIPlugin.Failure("VSWITCH_CFG_RELOAD_FAILURE", [ str(exitcode) ])