Commit 5f46e707 by Ed Crewe

user getpass

parent 535f28d9
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# You will need to edit the constants below to match your setup ... # You will need to edit the constants below to match your setup ...
import sys import sys
import getpass
import urllib2 import urllib2
import urllib import urllib
from urlparse import urljoin from urlparse import urljoin
...@@ -32,13 +33,12 @@ except: ...@@ -32,13 +33,12 @@ except:
def get_auth(): def get_auth():
""" Get authentication by passing to this script on the command line """ """ Get authentication by passing to this script on the command line """
if len(sys.argv) == 3: if len(sys.argv) > 1:
AUTH['username'] = sys.argv[1] AUTH['username'] = sys.argv[1]
AUTH['password'] = sys.argv[2]
return AUTH
else: else:
print 'You must call the test via:' AUTH['username'] = getpass.getuser()
print 'python proxy_test.py username password' AUTH['password'] = getpass.getpass('CAS Password for user %s:' % AUTH['username'])
return AUTH
def get_token(opener, url, token=TOKEN): def get_token(opener, url, token=TOKEN):
""" Get CSRF token """ """ Get CSRF token """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment