projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
brcompatd: Factor code out of prune_ports().
[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 95020ad49983718668b64d74dfdd5915fcf843e1..45231395df1e0cf5b9368789da663de35f6f1cc7 100644
(file)
--- a/
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py
+++ b/
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py
@@
-12,6
+12,7
@@
log = logging.getLogger("vswitch-cfg-update")
logging.basicConfig(filename="/var/log/vswitch-xsplugin.log", level=logging.DEBUG)
import os
logging.basicConfig(filename="/var/log/vswitch-xsplugin.log", level=logging.DEBUG)
import os
+import socket
import subprocess
cfg_mod="/root/vswitch/bin/ovs-cfg-mod"
import subprocess
cfg_mod="/root/vswitch/bin/ovs-cfg-mod"
@@
-162,6
+163,14
@@
class VSwitchControllerDialogue(Dialogue):
inputValues = pane.GetFieldValues()
self.controller = inputValues['address']
Layout.Inst().PopDialogue()
inputValues = pane.GetFieldValues()
self.controller = inputValues['address']
Layout.Inst().PopDialogue()
+
+ # Make sure the controller is specified as a valid dotted quad
+ try:
+ socket.inet_aton(self.controller)
+ except socket.error:
+ Layout.Inst().PushDialogue(InfoDialogue(Lang("Please enter in dotted quad format")))
+ return True
+
Layout.Inst().TransientBanner(Lang("Setting controller..."))
try:
self.SetController(self.controller)
Layout.Inst().TransientBanner(Lang("Setting controller..."))
try:
self.SetController(self.controller)