fix up dvr api def exceptions

Commit I6d98e83287833882515240d7db1faa4a1deb7da1 rehomed the DVR
API def into neutron-lib, but:
- The DVRMacAddressNotFound exception was never rehomed. While not used
externally today [1], it's foreseeable that implementations of the
extension will need it.
- The exception message used in HostMacAddressGenerationFailure of the
rehome patch mentions "DVR". This should not be the case as the
HostMacAddressGenerationFailure is generic in nature.

[1] http://codesearch.openstack.org/?q=DVRMacAddressNotFound

Change-Id: I88e1aa2acf22389f69cb7d5704c80a5eb72a9bbe
This commit is contained in:
Boden R 2017-11-10 13:46:16 -07:00
parent 073fd1dfed
commit 27a27c07e2
2 changed files with 22 additions and 1 deletions

View File

@ -522,7 +522,7 @@ class HostMacAddressGenerationFailure(ServiceUnavailable):
:param host: The host MAC address generation failed for.
"""
message = _("Unable to generate unique DVR mac for host %(host)s.")
message = _("Unable to generate unique mac for host %(host)s.")
class NetworkMacAddressGenerationFailure(ServiceUnavailable):

View File

@ -0,0 +1,21 @@
# Copyright (c) 2014 OpenStack Foundation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib._i18n import _
from neutron_lib import exceptions
class DVRMacAddressNotFound(exceptions.NotFound):
message = _("Distributed Virtual Router Mac Address for "
"host %(host)s does not exist.")