Commit 7b654f59 authored by djacques@chromium.org's avatar djacques@chromium.org

Added implicit empty password to 'presubmit_support.py'

BUG=363477
TEST=localtest

Review URL: https://codereview.chromium.org/238603002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@263781 0039d316-1c4b-4281-b951-d872f2087c98
parent 92c30092
...@@ -1562,6 +1562,7 @@ def Main(argv): ...@@ -1562,6 +1562,7 @@ def Main(argv):
if options.rietveld_private_key_file and options.rietveld_password: if options.rietveld_private_key_file and options.rietveld_password:
parser.error("Only one of --rietveld_private_key_file or " parser.error("Only one of --rietveld_private_key_file or "
"--rietveld_password can be passed to this program.") "--rietveld_password can be passed to this program.")
if options.rietveld_email_file: if options.rietveld_email_file:
with open(options.rietveld_email_file, "rb") as f: with open(options.rietveld_email_file, "rb") as f:
options.rietveld_email = f.read().strip() options.rietveld_email = f.read().strip()
...@@ -1574,19 +1575,16 @@ def Main(argv): ...@@ -1574,19 +1575,16 @@ def Main(argv):
rietveld_obj = None rietveld_obj = None
if options.rietveld_url: if options.rietveld_url:
# The empty password is permitted: '' is not None. # The empty password is permitted: '' is not None.
if options.rietveld_password is not None: if options.rietveld_private_key_file:
rietveld_obj = rietveld.CachingRietveld(
options.rietveld_url,
options.rietveld_email,
options.rietveld_password)
elif options.rietveld_private_key_file:
rietveld_obj = rietveld.JwtOAuth2Rietveld( rietveld_obj = rietveld.JwtOAuth2Rietveld(
options.rietveld_url, options.rietveld_url,
options.rietveld_email, options.rietveld_email,
options.rietveld_private_key_file) options.rietveld_private_key_file)
else: else:
parser.error("No password or secret key has been provided for " rietveld_obj = rietveld.CachingRietveld(
"Rietveld. Unable to connect.") options.rietveld_url,
options.rietveld_email,
options.rietveld_password)
if options.rietveld_fetch: if options.rietveld_fetch:
assert options.issue assert options.issue
props = rietveld_obj.get_issue_properties(options.issue, False) props = rietveld_obj.get_issue_properties(options.issue, False)
......
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