From 01c86b1ecc3e20add1d99007e25c16c6b009888f Mon Sep 17 00:00:00 2001 From: Joe Gregorio Date: Thu, 7 Jun 2012 14:31:32 -0400 Subject: [PATCH] Print explaination if we can't access ports 8080 or 9090. Reviewed in http://codereview.appspot.com/6307054/. Fixes issue #126. --- oauth2client/tools.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/oauth2client/tools.py b/oauth2client/tools.py index eeb9031..5d96ea4 100644 --- a/oauth2client/tools.py +++ b/oauth2client/tools.py @@ -117,6 +117,14 @@ def run(flow, storage, http=None): success = True break FLAGS.auth_local_webserver = success + if not success: + print 'Failed to start a local webserver listening on either port 8080' + print 'or port 9090. Please check your firewall settings and locally' + print 'running programs that may be blocking or using those ports.' + print + print 'Falling back to --noauth_local_webserver and continuing with', + print 'authorization.' + print if FLAGS.auth_local_webserver: oauth_callback = 'http://%s:%s/' % (FLAGS.auth_host_name, port_number)