Merge "Fix log and test for NeutronAPI.update_port_dhcp_opts"
This commit is contained in:
commit
1b15e6aafc
@ -88,7 +88,5 @@ class NeutronAPI(object):
|
||||
try:
|
||||
self.client.update_port(port_id, port_req_body)
|
||||
except neutron_client_exc.NeutronClientException:
|
||||
LOG.exception(_('Neutron error updating port: %s') %
|
||||
port_id)
|
||||
raise exception.FailedToUpdateDHCPOptOnPort(
|
||||
port_id=port_id)
|
||||
LOG.exception(_("Failed to update Neutron port %s."), port_id)
|
||||
raise exception.FailedToUpdateDHCPOptOnPort(port_id=port_id)
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
import mock
|
||||
|
||||
from neutronclient.common import exceptions as neutron_client_exc
|
||||
from neutronclient.v2_0 import client
|
||||
from oslo.config import cfg
|
||||
|
||||
@ -108,7 +109,7 @@ class TestNeutron(base.TestCase):
|
||||
with mock.patch.object(client.Client,
|
||||
"update_port") as mock_update_port:
|
||||
mock_update_port.side_effect = (
|
||||
exception.FailedToUpdateDHCPOptOnPort("test exception"))
|
||||
neutron_client_exc.NeutronClientException())
|
||||
self.assertRaises(
|
||||
exception.FailedToUpdateDHCPOptOnPort,
|
||||
api.update_port_dhcp_opts,
|
||||
|
Loading…
Reference in New Issue
Block a user