Keystone server does not define "enabled" attribute for Region but mentions in v3 regions.py

Bug #1615076 reported by Nisha Yadav
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Vishakha Agarwal
python-keystoneclient
Fix Released
Undecided
Vishakha Agarwal

Bug Description

The bug was discovered while writing the region functional tests [1]. The create() and update() calls [2] in regions.py mention the "enabled" attribute, but the specs [3] don't mention it and the code [4] doesn't support it. We don't check for "enabled" in the region schema either [5].

So, it's being stored as an extra attribute and it even works if one passes {'enabled': 'WHATEVER'}

[1] https://review.openstack.org/#/c/339158/
[2] https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/v3/regions.py
[3] http://specs.openstack.org/openstack/keystone-specs/api/v3/identity-api-v3.html#regions-v3-regions
[4] https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L33-L49
[5] https://github.com/openstack/keystone/blob/master/keystone/catalog/schema.py#L17-L43

Tags: office-hours
Nisha Yadav (ynisha11)
summary: - Keystone server does not define "enabled" atribute for Region but
+ Keystone server does not define "enabled" attribute for Region but
mentions in v3 regions.py
affects: python-keystoneclient → keystone
Revision history for this message
David Lyle (david-lyle) wrote :

Just adding some additional data. python-keystoneclient by default adds "enabled": True, but also accepts an enabled parameter on region create. The comment indicates that if "enabled" is False, the region will not be added to the catalog. Now for the kicker, since there is not an "enabled" attribute in the region schema, the "enabled" value gets added to the extra blob. And strangely, the extra blob is not update-able. The enabled trigger seems like it should either be removed altogether or in the schema so that it can be updated.

Changed in keystone:
status: New → Confirmed
Revision history for this message
David Lyle (david-lyle) wrote :

after further testing enabled seems to do nothing in v3 as endpoints added to the regions with enabled being true or false both show up in the catalog returned with the token. This seems to be a documentation issue with python-keystoneclient and taking a parameter that in v3 seems to do nothing.

Revision history for this message
Lance Bragstad (lbragstad) wrote :

Adding python-keystoneclient to this bug report so that we can get a release that doesn't assume `enabled` attributes for regions. Keeping this open for keystone so that we can make sure we're not documenting it, officially or in code comments.

tags: added: office-hours
Changed in keystone:
assignee: nobody → Vishakha Agarwal (vishakha.agarwal)
Changed in python-keystoneclient:
assignee: nobody → Vishakha Agarwal (vishakha.agarwal)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/594921

Changed in python-keystoneclient:
status: New → In Progress
Changed in keystone:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/594921
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=b7db5668c1223908987060a767078f010c83df6f
Submitter: Zuul
Branch: master

commit b7db5668c1223908987060a767078f010c83df6f
Author: Vishakha Agarwal <email address hidden>
Date: Wed Aug 22 15:35:29 2018 +0530

    Deprecate region enabled parameter

    We don't check for "enabled" in the region
    anywhere thus deprecating it from the create()
    and update calls of the v3/region.py. We dont
    use it in schema [1] as well as [2].

    [1] https://github.com/openstack/keystone/blob/master/keystone/catalog/schema.py#L34
    [2] https://github.com/openstack/keystone/blob/master/keystone/catalog/backends/sql.py#L33-L49

    Change-Id: I0257d5d42916e3b4d008e592d54eeeebec591633
    Partial-Bug: #1615076

Changed in keystone:
status: In Progress → Fix Released
Changed in python-keystoneclient:
status: In Progress → Fix Released
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.