Bug 857752 - Keystone assertion failing
Summary: Keystone assertion failing
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: openstack-keystone
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Adam Young
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-16 19:11 UTC by Steven Dake
Modified: 2016-04-26 16:05 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-31 18:36:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch which triggers keystone to assert incorrectly (4.77 KB, patch)
2012-09-16 19:20 UTC, Steven Dake
no flags Details | Diff

Description Steven Dake 2012-09-16 19:11:38 UTC
Description of problem:
In service.py definition _get_token_ref(~line 380), an assertion fails:

        if belongs_to:
            assert token_ref['tenant']['id'] == belongs_to

Printing these values when the assertion occurs, belongs_to is None.  The token_ref is set to a token.  However, according to:

http://docs.python.org/library/stdtypes.html

The truth value of None is False, so the if conditional should not execute, but seems unclear to me why it is doing so.

According to PEP8 style guidelines:
http://www.python.org/dev/peps/pep-0008/

"Comparisons to singletons like None should always be done with is or is not, never the equality operators.

Also, beware of writing if x when you really mean if x is not None -- e.g. when testing whether a variable or argument that defaults to None was set to some other value. The other value might have a type (such as a container) that could be false in a boolean context!
"

Current master has similar problems with its assertions.

Note other keystone assertions have similar problems but if possible, I would like this one fixed since I think there may be a security problem with heat + f17.

Version-Release number of selected component (if applicable):
openstack-keystone-2012.1.1-1.fc17.noarch


How reproducible:
100%


Steps to Reproduce:
1. Modify heat to use proxy_token in novaclient
2.
3.
  
Actual results:
Keystone will assert and not complete the operation.

Expected results:
The meaning of proxy_token is undocumented (atleast I can't find any).  I expect the way it is meant to work is to use a token in place of a api_key so new authentication isn't necessary via an api_key (instead using the token) .  I have attached the heat patch from master if you want to duplicate.  If I delete the assertion, heat is able to authenticate via the token.

Additional info:

Comment 1 Steven Dake 2012-09-16 19:20:54 UTC
Created attachment 613499 [details]
patch which triggers keystone to assert incorrectly

Comment 2 Adam Young 2012-12-06 16:27:16 UTC
Please open an upstream bug and add a link to it in this report.  Reproducing from Heat is not going to be sufficient:  please cache the actual web requests going to Keystone, to include the data used to populate the Keystone Repo.

Comment 3 Fedora End Of Life 2013-07-03 19:44:33 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2013-07-31 18:36:08 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.