mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Use value of --user as monorail email address if it is an email address
While fetching monorail issues, @chromium.org is appended to the --user option even if the original --user option is already a email address (e.g. user@google.com). Change-Id: I2442f4ea977b2681a72271f7c20fabb1ceaa351c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1790222 Reviewed-by: Andrii Shyshkalov <tandrii@google.com> Commit-Queue: Peter Lee <pkl@chromium.org>
This commit is contained in:
@@ -380,8 +380,9 @@ class MyActivity(object):
|
||||
|
||||
def monorail_issue_search(self, project):
|
||||
epoch = datetime.utcfromtimestamp(0)
|
||||
# TODO(tandrii): support non-chromium email, too.
|
||||
user_str = '%s@chromium.org' % self.user
|
||||
# Defaults to @chromium.org email if one wasn't provided on -u option.
|
||||
user_str = (self.options.email if self.options.email.find('@') >= 0
|
||||
else '%s@chromium.org' % self.user)
|
||||
|
||||
issues = self.monorail_query_issues(project, {
|
||||
'maxResults': 10000,
|
||||
@@ -850,7 +851,9 @@ def main():
|
||||
parser.error('Args unsupported')
|
||||
if not options.user:
|
||||
parser.error('USER/USERNAME is not set, please use -u')
|
||||
options.user = username(options.user)
|
||||
# Retains the original -u option as the email address.
|
||||
options.email = options.user
|
||||
options.user = username(options.email)
|
||||
|
||||
logging.basicConfig(level=options.verbosity)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user