Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-7731

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • openstack-cinder
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • ?
    • ?
    • ?
    • None
    • Moderate

      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
       

              Unassigned Unassigned
              ybenshim Yosi Ben Shimon
              rhos-dfg-storage-squad-cinder
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: