[rbac] enable service request results with validation error 'disabled_reason' is a required property when using admin role

Bug #2069528 reported by Yosi Ben Shimon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

When using admin role, the response for "enable service" request doesn't contain the "disabled_reason" property as the tempest validation expects.
* it happens to admin only since this operation is forbidden for readers & members.

tempest.log:

2024-06-16 11:53:44,270 884733 INFO [tempest.lib.common.rest_client] Request (ProjectAdminTests:test_enable_service): 200 PUT http://10.0.0.135:8776/v3/2de8fad2ade64a978b3817e3e0c9b00a/os-services/enable 0.032s
    2024-06-16 11:53:44,271 884733 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'Openstack-Api-Version': 'volume 3.3', 'X-Auth-Token': '<omitted>'}
            Body: {"binary": "cinder-backup", "host": "controller-1"}
        Response - Headers: {'date': 'Sun, 16 Jun 2024 11:53:44 GMT', 'server': 'Apache', 'content-length': '106', 'x-compute-request-id': 'req-316f5214-d9f9-4af3-baa4-eaaf9c0ce201', 'openstack-api-version': 'volume 3.3', 'vary': 'OpenStack-API-Version', 'x-openstack-request-id': 'req-316f5214-d9f9-4af3-baa4-eaaf9c0ce201', 'content-type': 'application/json', 'connection': 'close', 'status': '200', 'content-location': 'http://10.0.0.135:8776/v3/2de8fad2ade64a978b3817e3e0c9b00a/os-services/enable'}
            Body: b'{"disabled": false, "host": "controller-1", "service": "", "binary": "cinder-backup", "status": "enabled"}'

    Traceback (most recent call last):
      File "/home/stack/tempest-auto/tempest/tempest/lib/common/rest_client.py", line 1101, in validate_response
        jsonschema.validate(body, body_schema,
      File "/usr/lib/python3.9/site-packages/jsonschema/validators.py", line 934, in validate
        raise error
    jsonschema.exceptions.ValidationError: 'disabled_reason' is a required property

    Failed validating 'required' in schema:
        {'additionalProperties': False,
         'properties': {'binary': {'type': 'string'},
                        'disabled': {'type': 'boolean'},
                        'disabled_reason': {'type': ['string', 'null']},
                        'host': {'type': 'string'},
                        'service': {'type': 'string'},
                        'status': {'enum': ['enabled', 'disabled']}},
         'required': ['disabled',
                      'status',
                      'host',
                      'service',
                      'binary',
                      'disabled_reason'],
         'type': 'object'}

    On instance:
        {'binary': 'cinder-backup',
         'disabled': False,
         'host': 'controller-1',
         'service': '',
         'status': 'enabled'}

rhosp-release: Red Hat OpenStack Platform release 17.1.3 (Wallaby)
Cinder version: 7.4.1

Tags: rbac
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

If this is a bug in downstream product then report the bug to the vendor.
This is not a bug tracker for any downstream product but upstream development. It should contain upstream release version/name instead of any downstream product name or version.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.