X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=xenserver%2Fusr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py;h=31a48c37dc47ac0586efdcabb2986a31c73c9f43;hb=594624655524ccaa5a73d41b6cec163869bfab6d;hp=f3d9bf347346543f3f581a7d5286f676399b1b2e;hpb=576e26d7b47f4e53116ef0b5f035d260f426d37b;p=sliver-openvswitch.git diff --git a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py index f3d9bf347..31a48c37d 100644 --- a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py +++ b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py @@ -7,9 +7,7 @@ # Copyright (c) 2009 Nicira Networks. -import logging -log = logging.getLogger("vswitch-cfg-update") -logging.basicConfig(filename="/var/log/vswitch-xsplugin.log", level=logging.DEBUG) +from XSConsoleLog import * import os import socket @@ -36,7 +34,7 @@ class VSwitchService: try: output = ShellPipe(["service", self.name, "version"]).Stdout() except StandardError, e: - log.error("version retrieval error: " + str(e)) + XSLogError("vswitch version retrieval error: " + str(e)) return "" for line in output: if self.processname in line: @@ -47,7 +45,7 @@ class VSwitchService: try: output = ShellPipe(["service", self.name, "status"]).Stdout() except StandardError, e: - log.error("status retrieval error: " + str(e)) + XSLogError("vswitch status retrieval error: " + str(e)) return "" if len(output) == 0: return "" @@ -66,7 +64,7 @@ class VSwitchService: try: ShellPipe(["service", self.name, "restart"]).Call() except StandardError, e: - log.error("restart error: " + str(e)) + XSLogError("vswitch restart error: " + str(e)) @classmethod def Inst(cls, name, processname=None): @@ -85,7 +83,7 @@ class VSwitchConfig: output = ShellPipe([cfg_mod, "-vANY:console:emer", "-F", vswitchd_cfg_filename, "-q", key]).Stdout() except StandardError, e: - log.error("config retrieval error: " + str(e)) + XSLogError("config retrieval error: " + str(e)) return "" if len(output) == 0: