Commit d528cb88 authored by maruel@chromium.org's avatar maruel@chromium.org

Propagate host to _GetAuthToken() to make it coherent.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/5342001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@67358 0039d316-1c4b-4281-b951-d872f2087c98
parent a7a1a83b
......@@ -220,10 +220,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
......@@ -235,7 +236,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(
......@@ -318,7 +319,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."
......
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