Skip to content

Commit

Permalink
WSAA: mejoro mensaje de error (CLI)
Browse files Browse the repository at this point in the history
  • Loading branch information
reingart committed Dec 28, 2013
1 parent c8e1965 commit 94b7bac
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wsaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,26 @@ def Autenticar(self, service, crt, key, wsdl=None, proxy=None, cache=None):
cacert = len(argv)>7 and argv[7] or CACERT
DEBUG = "--debug" in args

print "Usando CRT=%s KEY=%s URL=%s SERVICE=%s TTL=%s" % (crt, key, url, service, ttl)
print >> sys.stderr, "Usando CRT=%s KEY=%s URL=%s SERVICE=%s TTL=%s" % (crt, key, url, service, ttl)

# creo el objeto para comunicarme con el ws
wsaa = WSAA()
wsaa.LanzarExcepciones = True

if '--proxy' in args:
proxy = sys.argv[sys.argv.index("--proxy")+1]
print "Usando PROXY:", proxy
print >> sys.stderr, "Usando PROXY:", proxy
else:
proxy = None

ta = wsaa.Autenticar(service, crt, key, url, proxy)
if not ta:
if DEBUG:
print >> sys.stderr, wsaa.Traceback
sys.exit(u"Excepcion: %s" % wsaa.Excepcion)

else:
print ta

if DEBUG:
print "Source:", wsaa.ObtenerTagXml('source')
Expand Down

0 comments on commit 94b7bac

Please sign in to comment.