Merge "Remove upgrade specific info from user facing exception text"

This commit is contained in:
Zuul 2019-09-25 10:29:20 +00:00 committed by Gerrit Code Review
commit 627c461a62
2 changed files with 13 additions and 9 deletions

View File

@ -3361,22 +3361,28 @@ class API(base_api.NetworkAPI):
if p.get('resource_request'): if p.get('resource_request'):
if not provider_mappings: if not provider_mappings:
# TODO(gibi): Remove this check when compute RPC API is
# bumped to 6.0
# NOTE(gibi): This should not happen as the API level # NOTE(gibi): This should not happen as the API level
# minimum compute service version check ensures that the # minimum compute service version check ensures that the
# compute services already send the RequestSpec during # compute services already send the RequestSpec during
# the move operations between the source and the # the move operations between the source and the
# destination and the dest compute calculates the # destination and the dest compute calculates the
# mapping based on that. # mapping based on that.
LOG.warning(
"Provider mappings are not available to the compute "
"service but are required for ports with a resource "
"request. If compute RPC API versions are pinned for "
"a rolling upgrade, you will need to retry this "
"operation once the RPC version is unpinned and the "
"nova-compute services are all upgraded.",
instance=instance)
raise exception.PortUpdateFailed( raise exception.PortUpdateFailed(
port_id=p['id'], port_id=p['id'],
reason=_( reason=_(
"Provider mappings are not available to the " "Provider mappings are not available to the "
"compute service but are required for ports with " "compute service but are required for ports with "
"a resource request. If compute RPC API versions " "a resource request."))
"are pinned for a rolling upgrade, you will need "
"to retry this operation once the RPC version is "
"unpinned and the nova-compute services are all "
"upgraded."))
# NOTE(gibi): In the resource provider mapping there can be # NOTE(gibi): In the resource provider mapping there can be
# more than one RP fulfilling a request group. But resource # more than one RP fulfilling a request group. But resource

View File

@ -4580,10 +4580,8 @@ class TestNeutronv2WithMock(TestNeutronv2Base):
instance, 'new-host', migration, provider_mappings=None) instance, 'new-host', migration, provider_mappings=None)
self.assertIn( self.assertIn(
"Provider mappings are not available to the compute service but " "Provider mappings are not available to the compute service but "
"are required for ports with a resource request. If compute RPC " "are required for ports with a resource request.",
"API versions are pinned for a rolling upgrade, you will need to " six.text_type(ex))
"retry this operation once the RPC version is unpinned and the "
"nova-compute services are all upgraded.", six.text_type(ex))
def test_get_pci_mapping_for_migration(self): def test_get_pci_mapping_for_migration(self):
instance = fake_instance.fake_instance_obj(self.context) instance = fake_instance.fake_instance_obj(self.context)