-
Notifications
You must be signed in to change notification settings - Fork 77
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
StopIteration error after Rally Upgrade and switch to LDAP authentication #38
Comments
Also, a SSL Certificate was added to the Rally server when the IT department took over management of Rally. |
My recommendation on the initial approach given the environment you described is to take pyral out of the picture to attempt to determine if there is some other basic dynamic causing the symptoms you've observed. Here's a Python script that uses the requests module to make a simple Rally WSAPI request. Substitute your local Rally OnPrem server and suitable credentials. Does this run successfully in your environment? #!/usr/local/bin/python2.7 ################################################################################################ basic_rally_request - Use the Requests module to connect to Rally and pull backRally Subscription information################################################################################################ import sys import requests ################################################################################################ RALLY_SERVER = "rally1.rallydev.com" RALLY_BASE_URL = "https://%s/slm/webservice/v2.0" % RALLY_SERVER ################################################################################################ def main(args):
################################################################################################ if name == "main": |
Thank you for the script. It seemed to work fine. The output is below.
|
I think I may have found the issue. Our on-premise Rally server uses LDAP for authentication. Thus when I look at my user information in Rally I have a "User Name" which is a full e-mail address joeuser@domain.com, and I have an "On-Premise LDAP User Name" which is just the username portion of the e-mail address, joeuser. When I create my Rally object I pass in my LDAP username and password, which allows authentication to work just fine. But I think the queries to Rally fail after that since PyRal has my LDAP username, not my Rally user name. |
I modified restapi.py and was able to get my code working again. Here are the changes I made
|
incorporated user contributed code in 1.1.1 |
see related issues: RallyTools#38 and RallyTools#134
Hello. I have a few scripts using PyRal that worked fine until the IT department took over management of Rally. The Rally database used did not change, but we moved from On-Premises 2014.1 to 2014.2 and switched to using the Rally LDAP module for authentication. Below is a traceback showing the error. This occurs on both a Mac OS X 10.9 and Red Hat 6 Linux system.
Thank you for your time.
Version Info
pyral.version
(1, 1, 0)
Rally On-Premises 2014.2
Using Rally LDAP module for authentication
Mac OS 10.9.5
Python 2.7.8 (default, Jul 13 2014, 17:11:32)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
py27-requests @2.4.0_0 (via MacPorts)
Red Hat Enterprise Linux Workstation release 6.3 (Santiago)
Python 2.6.6 (r266:84292, Aug 28 2012, 10:55:56)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
requests v2.3.0
Mac OS X traceback
(Note sure why the Mac OS run has the Unverified HTTPS request warning, my script is identical on both machines. I'm thinking it has something to do with the different requests version.)
$ query_rally.py --credentialsFromFile PB9225
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:730: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html (This warning will only appear once by default.)
InsecureRequestWarning)
Traceback (most recent call last):
File "./query_rally.py", line 371, in
main(sys.argv[1:])
File "./query_rally.py", line 347, in main
myQueryRally.setRallyObject()
File "./query_rally.py", line 137, in setRallyObject
verify_ssl_cert=self.verify_ssl_cert)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyral/restapi.py", line 227, in init
self.contextHelper.check(self.server)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyral/context.py", line 220, in check
self._getDefaults(response)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyral/context.py", line 259, in _getDefaults
user = response.next()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyral/rallyresp.py", line 256, in next
raise StopIteration
StopIteration
Linux traceback
$ query_rally.py --credentialsFromFile PB9225
Traceback (most recent call last):
File "query_rally.py", line 371, in
main(sys.argv[1:])
File "query_rally.py", line 347, in main
myQueryRally.setRallyObject()
File "query_rally.py", line 137, in setRallyObject
verify_ssl_cert=self.verify_ssl_cert)
File "/ascldap/users/aalorbe/trac/easy_install_files/2.6/site_packages/pyral-1.1.0-py2.6.egg/pyral/restapi.py", line 227, in init
self.contextHelper.check(self.server)
File "/ascldap/users/aalorbe/trac/easy_install_files/2.6/site_packages/pyral-1.1.0-py2.6.egg/pyral/context.py", line 220, in check
self._getDefaults(response)
File "/ascldap/users/aalorbe/trac/easy_install_files/2.6/site_packages/pyral-1.1.0-py2.6.egg/pyral/context.py", line 259, in _getDefaults
user = response.next()
File "/ascldap/users/aalorbe/trac/easy_install_files/2.6/site_packages/pyral-1.1.0-py2.6.egg/pyral/rallyresp.py", line 256, in next
raise StopIteration
StopIteration
The text was updated successfully, but these errors were encountered: