From 6080f2c0080aadeb9bdcb61e21c150c288ce7bc8 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Tue, 18 Jun 2013 17:50:50 +0900 Subject: quantum_adapter: check if quantum_controller_addr is valid With this, more understandable error will be produced. Otherwise it results in mysterious error like transaction error: {"details":"Table Bridge column controller row 69da7121-51fa-4d6e-ad24-18ff9c857b87 references nonexistent row 17c4aa64-ed91-4d8a-a905-a137e6969ad9 in table Controller.","error":"referential integrity violation"} hub: uncaught exception: Traceback (most recent call last): File "/ryu/ryu/lib/hub.py", line 50, in _launch func(*args, **kwargs) File "/ryu/ryu/base/app_manager.py", line 104, in _event_loop handler(ev) File "/ryu/ryu/app/quantum_adapter.py", line 383, in conf_switch_set_handler self._conf_switch_set_ovsdb_addr(ev.dpid, ev.value) File "/ryu/ryu/app/quantum_adapter.py", line 372, in _conf_switch_set_ovsdb_addr ovs_switch.set_ovsdb_addr(dpid, value) File "/ryu/ryu/app/quantum_adapter.py", line 169, in set_ovsdb_addr ovs_bridge.set_controller([self.ctrl_addr]) File "/ryu/ryu/lib/ovs/bridge.py", line 128, in set_controller self.run_command([command]) File "/ryu/ryu/lib/ovs/bridge.py", line 101, in run_command self.vsctl.run_command(commands, self.timeout, self.exception) File "/ryu/ryu/lib/ovs/vsctl.py", line 1006, in run_command self._run_command(commands) File "/ryu/ryu/lib/ovs/vsctl.py", line 999, in _run_command self._do_main(commands) File "/ryu/ryu/lib/ovs/vsctl.py", line 927, in _do_main if self._do_vsctl(idl_, commands): File "/ryu/ryu/lib/ovs/vsctl.py", line 898, in _do_vsctl vsctl_fatal('transaction error: %s' % txn_.get_error()) File "/ryu/ryu/lib/ovs/vsctl.py", line 132, in vsctl_fatal raise Exception(msg) # not call ovs.utils.ovs_fatal for reusability Exception: transaction error: {"details":"Table Bridge column controller row 69da7121-51fa-4d6e-ad24-18ff9c857b87 references nonexistent row 17c4aa64-ed91-4d8a-a905-a137e6969ad9 in table Controller.","error":"referential integrity violation"} Signed-off-by: Isaku Yamahata Signed-off-by: FUJITA Tomonori --- ryu/app/quantum_adapter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ryu/app/quantum_adapter.py b/ryu/app/quantum_adapter.py index b77451fc..eca13606 100644 --- a/ryu/app/quantum_adapter.py +++ b/ryu/app/quantum_adapter.py @@ -134,6 +134,8 @@ class OVSSwitch(object): self.logger = logger self.q_api = q_api self.ctrl_addr = CONF.quantum_controller_addr + if not self.ctrl_addr: + raise ValueError('option quantum_controler_addr must be speicfied') self.ovsdb_addr = None self.tunnel_ip = None -- cgit v1.2.3