Merge "Fix log and test for NeutronAPI.update_port_dhcp_opts"

This commit is contained in:
Jenkins 2014-02-06 23:32:22 +00:00 committed by Gerrit Code Review
commit 1b15e6aafc
2 changed files with 4 additions and 5 deletions

View File

@ -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)

View File

@ -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,