Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Cloud:OpenStack:Newton
openstack-neutron-doc
0001-OVS-Raise-RuntimeError-in_get_dp-if-id-is-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-OVS-Raise-RuntimeError-in_get_dp-if-id-is-None.patch of Package openstack-neutron-doc
diff -crB --new-file neutron-9.4.2.dev21-backup/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_bridge.py neutron-9.4.2.dev21/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_bridge.py *** neutron-9.4.2.dev21-backup/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_bridge.py 2017-09-23 11:10:44.000000000 -0700 --- neutron-9.4.2.dev21/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_bridge.py 2019-03-22 15:02:39.999090166 -0700 *************** *** 43,52 **** """ while True: if self._cached_dpid is None: ! dpid_str = self.get_datapath_id() LOG.info(_LI("Bridge %(br_name)s has datapath-ID %(dpid)s"), ! {"br_name": self.br_name, "dpid": dpid_str}) ! self._cached_dpid = int(dpid_str, 16) try: dp = self._get_dp_by_dpid(self._cached_dpid) return dp, dp.ofproto, dp.ofproto_parser --- 43,54 ---- """ while True: if self._cached_dpid is None: ! dpid = self.get_datapath_id() LOG.info(_LI("Bridge %(br_name)s has datapath-ID %(dpid)s"), ! {"br_name": self.br_name, "dpid": dpid}) ! if dpid is None: ! raise RuntimeError("Unknown datapath id.") ! self._cached_dpid = int(dpid, 16) try: dp = self._get_dp_by_dpid(self._cached_dpid) return dp, dp.ofproto, dp.ofproto_parser diff -crB --new-file neutron-9.4.2.dev21-backup/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_ovs_bridge.py neutron-9.4.2.dev21/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_ovs_bridge.py *** neutron-9.4.2.dev21-backup/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_ovs_bridge.py 2017-09-23 11:10:44.000000000 -0700 --- neutron-9.4.2.dev21/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_ovs_bridge.py 2019-03-21 16:38:25.702609640 -0700 *************** *** 33,35 **** --- 33,40 ---- # make sure it correctly raises RuntimeError, not UnboundLocalError as # in LP https://bugs.launchpad.net/neutron/+bug/1588042 self.assertRaises(RuntimeError, br._get_dp) + + def test__get_dp_when_get_datapath_id_returns_None(self): + br = self.br_int_cls('br-int') + with mock.patch.object(br, 'get_datapath_id', return_value=None): + self.assertRaises(RuntimeError, br._get_dp)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor