From 5d650753e272711c0281e232c3f5eaca730082f7 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Tue, 24 Sep 2019 10:44:46 +0200 Subject: [PATCH] Remove upgrade specific info from user facing exception text One of the PortUpdateFailed exception usage case introduced by the bp support-move-ops-with-qos-ports overly chatty about upgrade and pinned RPC. This message can reach the end user during resize so the deployment specific information is removed from the exception message and logged instead. Also a TODO is added that the whole check can be removed once we bump the compute RPC to 6.0 Change-Id: I37b02da02a42cab09d2efe6d1a4b88cbc8b9b0d0 --- nova/network/neutronv2/api.py | 16 +++++++++++----- nova/tests/unit/network/test_neutronv2.py | 6 ++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/nova/network/neutronv2/api.py b/nova/network/neutronv2/api.py index 549c73e502c0..341440937c7a 100644 --- a/nova/network/neutronv2/api.py +++ b/nova/network/neutronv2/api.py @@ -3361,22 +3361,28 @@ class API(base_api.NetworkAPI): if p.get('resource_request'): 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 # minimum compute service version check ensures that the # compute services already send the RequestSpec during # the move operations between the source and the # destination and the dest compute calculates the # 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( port_id=p['id'], reason=_( "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.")) + "a resource request.")) # NOTE(gibi): In the resource provider mapping there can be # more than one RP fulfilling a request group. But resource diff --git a/nova/tests/unit/network/test_neutronv2.py b/nova/tests/unit/network/test_neutronv2.py index 118ca2655fff..ebd281057b6a 100644 --- a/nova/tests/unit/network/test_neutronv2.py +++ b/nova/tests/unit/network/test_neutronv2.py @@ -4580,10 +4580,8 @@ class TestNeutronv2WithMock(TestNeutronv2Base): instance, 'new-host', migration, provider_mappings=None) self.assertIn( "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.", six.text_type(ex)) + "are required for ports with a resource request.", + six.text_type(ex)) def test_get_pci_mapping_for_migration(self): instance = fake_instance.fake_instance_obj(self.context)