abfb2c6061ecb7480f8c1937230e382d238e7cd9

When fetching the attachments associated with a volume, Cinder only return the host information (host_name) if the request is coming from an admin otherwise returns None. This is the correct behavior but with a little caveat. When Glance is configured to use Cinder as it's backend, it also requires the volume attachment information to find out which attachments exists for a specific host. This helps make smart decisions on wheather we want to disconnect a volume or not[1]. The problem currently is, the ``host_name`` field is not exposed to other openstack services, like glance. This patch enables services like Glance API to be able to fetch the ``host_name`` information for attachments by checking the ``service`` role in the context of the request. This helps ensures any non-admin user, apart from the admin or service category shouldn't be able to view the ``host_name`` information for attachments. [1] https://review.opendev.org/c/openstack/glance_store/+/962408 Change-Id: Icea868bf6619f3ab0a00c4e72185f07e66e4a932 Signed-off-by: Rajat Dhasmana <rajatdhasmana@gmail.com>
…
…
…
…
…
…
OpenStack Cinder
OpenStack Cinder is a storage service for an open cloud computing service.
You can learn more about Cinder at:
Getting Started
If you'd like to run from the master branch, you can clone the git repo:
git clone https://opendev.org/openstack/cinder
If you'd like to contribute, please see the information in CONTRIBUTING.rst
You can raise bugs on Launchpad
Python client
Description
Languages
Python
99.7%
Smarty
0.3%