mirror of
https://github.com/openvswitch/ovs
synced 2025-10-29 15:28:56 +00:00
xenserver: Handle slave disconnection more gracefully in xsconsole plugin
When a slave cannot connect to the master, the vSwitch xsconsole plugin complained with some Python style errors on the main display. This commit cleans up that behavior. Bug #1341
This commit is contained in:
@@ -90,7 +90,11 @@ class VSwitchControllerDialogue(Dialogue):
|
|||||||
|
|
||||||
self.hostsInPool = 0
|
self.hostsInPool = 0
|
||||||
self.hostsUpdated = 0
|
self.hostsUpdated = 0
|
||||||
self.controller = data.GetPoolForThisHost().get("other_config", {}).get("vSwitchController", "")
|
pool = data.GetPoolForThisHost()
|
||||||
|
if pool is not None:
|
||||||
|
self.controller = pool.get("other_config", {}).get("vSwitchController", "")
|
||||||
|
else:
|
||||||
|
self.controller = ""
|
||||||
|
|
||||||
choiceDefs = [
|
choiceDefs = [
|
||||||
ChoiceDef(Lang("Set pool-wide controller"),
|
ChoiceDef(Lang("Set pool-wide controller"),
|
||||||
@@ -253,7 +257,13 @@ class XSFeatureVSwitch:
|
|||||||
inPane.AddStatusField(Lang("Version", 20), versionStr)
|
inPane.AddStatusField(Lang("Version", 20), versionStr)
|
||||||
|
|
||||||
inPane.NewLine()
|
inPane.NewLine()
|
||||||
dbController = data.GetPoolForThisHost().get("other_config", {}).get("vSwitchController", "")
|
|
||||||
|
pool = data.GetPoolForThisHost()
|
||||||
|
if pool is not None:
|
||||||
|
dbController = pool.get("other_config", {}).get("vSwitchController", "")
|
||||||
|
else:
|
||||||
|
dbController = ""
|
||||||
|
|
||||||
if dbController == "":
|
if dbController == "":
|
||||||
dbController = Lang("<None>")
|
dbController = Lang("<None>")
|
||||||
inPane.AddStatusField(Lang("Controller (config)", 20), dbController)
|
inPane.AddStatusField(Lang("Controller (config)", 20), dbController)
|
||||||
|
|||||||
Reference in New Issue
Block a user