Commit 711dc5e1 authored by Peter K. Lee's avatar Peter K. Lee Committed by Commit Bot

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/+/1790222Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@google.com>
Commit-Queue: Peter Lee <pkl@chromium.org>
parent b3b46a26
......@@ -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)
......
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