From cfa33d3b06a279f8f6dc6ad7d76d49feb36b0ace Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 26 Aug 2021 10:54:25 +0100 Subject: [PATCH] policy: Deprecate field from 'os-extended-server-attributes' policy Indicate that the 'os_compute_api:os-extended-server-attributes' will no longer control visibility of the 'OS-EXT-SRV-ATTR:hostname' attribute in a future release, following a deprecation period. Change-Id: I981a3bdb6c2f11f294cbb01689cf927d216b2439 Signed-off-by: Stephen Finucane --- nova/api/openstack/compute/views/servers.py | 2 ++ nova/policies/extended_server_attributes.py | 3 ++- .../notes/microversion-2-90-59fb6d4ec420b9f4.yaml | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nova/api/openstack/compute/views/servers.py b/nova/api/openstack/compute/views/servers.py index 4f9d7c52ab24..c14eee532583 100644 --- a/nova/api/openstack/compute/views/servers.py +++ b/nova/api/openstack/compute/views/servers.py @@ -408,6 +408,8 @@ class ViewBuilder(common.ViewBuilder): trusted_certs = instance.trusted_certs.ids server["server"]["trusted_image_certificates"] = trusted_certs + # TODO(stephenfin): Remove this check once we remove the + # OS-EXT-SRV-ATTR:hostname policy checks from the policy is Y or later if api_version_request.is_supported(request, min_version='2.90'): # API 2.90 made this field visible to non-admins, but we only show # it if it's not already added diff --git a/nova/policies/extended_server_attributes.py b/nova/policies/extended_server_attributes.py index e159a750c64c..93444219ff1a 100644 --- a/nova/policies/extended_server_attributes.py +++ b/nova/policies/extended_server_attributes.py @@ -45,7 +45,8 @@ also controlled by this policy rule, like the ``GET /servers*`` APIs. Microversion 2.90 made the ``OS-EXT-SRV-ATTR:hostname`` attribute available to all users, so this policy has no effect on that field for microversions 2.90 -and greater. +and greater. Controlling the visibility of this attribute for all microversions +is therefore deprecated and will be removed in a future release. """, operations=[ { diff --git a/releasenotes/notes/microversion-2-90-59fb6d4ec420b9f4.yaml b/releasenotes/notes/microversion-2-90-59fb6d4ec420b9f4.yaml index f80a35c890a2..0bc0b4d4be92 100644 --- a/releasenotes/notes/microversion-2-90-59fb6d4ec420b9f4.yaml +++ b/releasenotes/notes/microversion-2-90-59fb6d4ec420b9f4.yaml @@ -14,3 +14,11 @@ features: In addition, starting with the 2.90 microversion, the ``OS-EXT-SRV-ATTR:hostname`` field is now returned for all users. Previously this was restricted to admin users. +deprecations: + - | + The ``os_compute_api:os-extended-server-attributes`` policy controls + which users a number of server extended attributes are shown to. + Configuring visiblity of the ``OS-EXT-SRV-ATTR:hostname`` attribute via + this policy has now been deprecated and will be removed in a future + release. Upon removal, this attribute will be shown for all users + regardless of policy configuration.