Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: third_party/upload.py

Issue 5342001: Propagate host to _GetAuthToken() to fix the account type check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/upload.py
diff --git a/third_party/upload.py b/third_party/upload.py
index 279221412277035037f77515eb91b42b2c507913..5fb3bb20e8e2e80f67428ce5aeabe76b364ea185 100644
--- a/third_party/upload.py
+++ b/third_party/upload.py
@@ -218,10 +218,11 @@ class AbstractRpcServer(object):
req.add_header(key, value)
return req
- def _GetAuthToken(self, email, password):
+ def _GetAuthToken(self, host, email, password):
"""Uses ClientLogin to authenticate the user, returning an auth token.
Args:
+ host: Host to get a token against.
email: The user's email address
password: The user's password
@@ -233,7 +234,7 @@ class AbstractRpcServer(object):
The authentication token returned by ClientLogin.
"""
account_type = self.account_type
- if self.host.endswith(".google.com"):
+ if host.endswith(".google.com"):
# Needed for use inside Google.
account_type = "HOSTED"
req = self._CreateRequest(
@@ -316,7 +317,7 @@ class AbstractRpcServer(object):
for i in range(3):
credentials = self.auth_function()
try:
- auth_token = self._GetAuthToken(credentials[0], credentials[1])
+ auth_token = self._GetAuthToken(host, credentials[0], credentials[1])
except ClientLoginError, e:
if e.reason == "BadAuthentication":
print >>sys.stderr, "Invalid username or password."
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698