Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turning everything into OrderedDicts broke states.keystone.user_present() #22782

Closed
0xf10e opened this issue Apr 17, 2015 · 6 comments
Closed
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P2 Priority 2 Platform Relates to OS, containers, platform-based utilities like FS, system based apps Regression The issue is a bug that breaks functionality known to work in previous releases. severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module
Milestone

Comments

@0xf10e
Copy link
Contributor

0xf10e commented Apr 17, 2015

I think states.keystone.user_present() is broken in 2014.7.4 because this wasn't a problem before I updated to 2014.7.4:

          ID: cinder-user in Keystone
    Function: keystone.user_present
        Name: cinder
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1539, in call
                  **cdata['kwargs'])
                File "/var/cache/salt/minion/extmods/states/keystone.py", line 193, in user_present
                  for role in roles[tenant_role]:
              TypeError: list indices must be integers, not OrderedDict
     Started: 15:36:12.849284
    Duration: 101.783 ms
     Changes:   

So I hacked a tiny bit of debugging* into user_present() (just above line 180 and got this:

DEBUG: Roles for user "cinder": [OrderedDict([('service', ['admin'])])]

A list with a OrderedDict with a list with a tuple consisting of a string and a list with the string 'admin'?
Seems like the return of user_role_list() in modules.keystone changed quite a bit...

btw: I tried the keystone modules from branches develop and 2014.7.

*) And I suspect logging is broken, too, because I had to print to stderr...

@rallytime
Copy link
Contributor

Thanks for the report and for the debugging! If you're able, we'd love a pull request addressing this issue. If not, that's ok, too. We can take a look.

@rallytime rallytime added State-Module Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Regression The issue is a bug that breaks functionality known to work in previous releases. P2 Priority 2 labels Apr 17, 2015
@rallytime rallytime added this to the Approved milestone Apr 17, 2015
@0xf10e
Copy link
Contributor Author

0xf10e commented Apr 18, 2015

Yesterday I was way too flabbergasted to know where to look. Now I understand the problem is a bit higher in the stacktrace: It's probably in salt/state.py where things changed. Thus using older versions of the keystone modules doesn't help.

But I won't touch this until Monday because I don't fiddle with OpenStack when not paid for ;)

@0xf10e
Copy link
Contributor Author

0xf10e commented Apr 21, 2015

OK, I'm getting closer! Current theory:
My states passed keystone.user_present() a list of roles instead a dict of roles.
I guess this worked with a list of dicts but not with a list of OrderedDicts.... we'll see.

@0xf10e
Copy link
Contributor Author

0xf10e commented Apr 21, 2015

See #22894 for the fix of the actually just minor problem.

@rallytime
Copy link
Contributor

@0xf10e Awesome! Thanks very much for digging into this and for the fix!

@rallytime rallytime added the fixed-pls-verify fix is linked, bug author to confirm fix label Apr 21, 2015
thatch45 added a commit that referenced this issue Apr 21, 2015
@rallytime
Copy link
Contributor

Since your fix was merged, I am going to close out this issue. If this pops up again, feel free to comment and we'll happily open this again. Thanks!

0xf10e added a commit to fraunhoferfokus/openstack-formula that referenced this issue May 7, 2015
0xf10e added a commit to fraunhoferfokus/openstack-formula that referenced this issue May 13, 2015
0xf10e added a commit to fraunhoferfokus/openstack-formula that referenced this issue May 13, 2015
@jfindlay jfindlay added the Platform Relates to OS, containers, platform-based utilities like FS, system based apps label May 26, 2015
0xf10e added a commit to fraunhoferfokus/openstack-formula that referenced this issue Jun 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P2 Priority 2 Platform Relates to OS, containers, platform-based utilities like FS, system based apps Regression The issue is a bug that breaks functionality known to work in previous releases. severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module
Projects
None yet
Development

No branches or pull requests

3 participants