]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Raise an error from ovs_lib list operations
authorAkihiro Motoki <motoki@da.jp.nec.com>
Mon, 10 Feb 2014 06:24:54 +0000 (15:24 +0900)
committerAkihiro Motoki <motoki@da.jp.nec.com>
Wed, 12 Feb 2014 13:44:56 +0000 (22:44 +0900)
commitaa85a97ca2dcb06996ed133d864705f1dca722b1
tree1bac0ba344567ce7325f6611efd08bd73cc4d49f
parentc900327377380006050e4406b022aec7bd84ed54
Raise an error from ovs_lib list operations

Previously list operations in ovs_lib returns an empty list
if RuntimeError occurs and a caller cannot distinguish an error
from normal results. This commit changes ovs_lib list operations
(get_vif_port_set, get_vif_ports, get_bridges) to raise an
exception when RuntimeError occurs.

Note: callers of these commands are ovs/nec/ryu-agent and ovs_cleanup.
- plugin agents: these commands are inside in try/except clause
  in daemon loop and there is no need to change.
- ovs_cleanup: there is no error catch logic in main() at now
  and it calls commands other than ovs_lib, so it can be cleanup
  later if required.

It also fixes the code to use excutils.save_and_reraise_exception
when reraising an exception.

Change-Id: I2aa3b51b8661c75846cb588c08c8f8ee00c37004
Closes-Bug: #1277029
neutron/agent/linux/ovs_lib.py
neutron/tests/unit/openvswitch/test_ovs_lib.py