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

KeyError: 'return' when using SALTAPI_EAUTH=auto #19

Closed
arthurzenika opened this issue Jan 29, 2015 · 4 comments
Closed

KeyError: 'return' when using SALTAPI_EAUTH=auto #19

arthurzenika opened this issue Jan 29, 2015 · 4 comments
Labels
Milestone

Comments

@arthurzenika
Copy link
Contributor

$ pepper '*' test.ping
Traceback (most recent call last):
  File "/home/arthur/.virtualenvs/pepper/bin/pepper", line 265, in <module>
    exit_code, results = main()
  File "/home/arthur/.virtualenvs/pepper/bin/pepper", line 235, in main
    nodesJid = nodesJidRet['return'][0]['jid']
KeyError: 'return'

switching SALTAPI_EAUTH=pam in .pepperrc gets it to work.

Would be nice to catch this traceback.

@whiteinge whiteinge added the bug label Jan 29, 2015
@whiteinge whiteinge added this to the Alpha release milestone Jan 29, 2015
@whiteinge
Copy link
Contributor

Yeah, that's no good. We're obviously not checking for certain types of errors there. Can you paste the actual return from salt-api that you're getting?

@arthurzenika
Copy link
Contributor Author

The -H doesn't work to get debug this HTTP (should I open another issue ? ). For some reason the logger.debug in libpepper doesn't print out on the console here (using -v -H). Added some prints and got a simple :

Error with request HTTP Error 401: Unauthorized

salt-api side :

[INFO    ] 127.0.0.1 - - [30/Jan/2015:10:55:16] "POST /login HTTP/1.1" 401 742 "" "Python-urllib/2.7"
[INFO    ] 127.0.0.1 - - [30/Jan/2015:10:55:16] "POST / HTTP/1.1" 401 735 "" "Python-urllib/2.7"

@whiteinge
Copy link
Contributor

Thanks for filing this! I didn't realize the logging had been broken. Fixed in f623e84. A few error-handling enhancements have been made in 4cd1661 so you should see the correct 401 error now.

@whiteinge
Copy link
Contributor

Please reopen if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants