projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
datapath: Add a find the kernel source directory for Debian 2.6.32+.
[openvswitch]
/
xenserver
/
usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py
diff --git
a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py
b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py
index f3d9bf347346543f3f581a7d5286f676399b1b2e..99dd15d8da52bdd5d7ca958c0443b305ee0b108c 100644
(file)
--- a/
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py
+++ b/
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py
@@
-7,16
+7,13
@@
# Copyright (c) 2009 Nicira Networks.
# 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
import subprocess
import os
import socket
import subprocess
-cfg_mod="/usr/bin/ovs-cfg-mod"
-vswitchd_cfg_filename="/etc/ovs-vswitchd.conf"
+vsctl="/usr/bin/ovs-vsctl"
if __name__ == "__main__":
raise Exception("This script is a plugin for xsconsole and cannot run independently")
if __name__ == "__main__":
raise Exception("This script is a plugin for xsconsole and cannot run independently")
@@
-36,7
+33,7
@@
class VSwitchService:
try:
output = ShellPipe(["service", self.name, "version"]).Stdout()
except StandardError, e:
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 "<unknown>"
for line in output:
if self.processname in line:
return "<unknown>"
for line in output:
if self.processname in line:
@@
-47,7
+44,7
@@
class VSwitchService:
try:
output = ShellPipe(["service", self.name, "status"]).Stdout()
except StandardError, e:
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 "<unknown>"
if len(output) == 0:
return "<unknown>"
return "<unknown>"
if len(output) == 0:
return "<unknown>"
@@
-66,7
+63,7
@@
class VSwitchService:
try:
ShellPipe(["service", self.name, "restart"]).Call()
except StandardError, e:
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):
@classmethod
def Inst(cls, name, processname=None):
@@
-80,12
+77,11
@@
class VSwitchService:
class VSwitchConfig:
@staticmethod
class VSwitchConfig:
@staticmethod
- def Get(
key
):
+ def Get(
action
):
try:
try:
- output = ShellPipe([cfg_mod, "-vANY:console:emer", "-F",
- vswitchd_cfg_filename, "-q", key]).Stdout()
+ output = ShellPipe([vsctl, "-vANY:console:emer", action]).Stdout()
except StandardError, e:
except StandardError, e:
-
log.e
rror("config retrieval error: " + str(e))
+
XSLogE
rror("config retrieval error: " + str(e))
return "<unknown>"
if len(output) == 0:
return "<unknown>"
if len(output) == 0:
@@
-287,7
+283,7
@@
class XSFeatureVSwitch:
if dbController == "":
dbController = Lang("<None>")
inPane.AddStatusField(Lang("Controller (config)", 20), dbController)
if dbController == "":
dbController = Lang("<None>")
inPane.AddStatusField(Lang("Controller (config)", 20), dbController)
- controller = VSwitchConfig.Get("
mgmt.
controller")
+ controller = VSwitchConfig.Get("
get-
controller")
if controller == "":
controller = Lang("<None>")
elif controller[0:4] == "ssl:":
if controller == "":
controller = Lang("<None>")
elif controller[0:4] == "ssl:":