From d7e241a22cdf6e6384bc32237cb579995307644e Mon Sep 17 00:00:00 2001 From: Andrii Shyshkalov Date: Wed, 15 Nov 2017 05:11:32 -0800 Subject: [PATCH] bot_update: fix minor pylint issues. Change-Id: I2f500bb8089039e689d5a989eb77f91374528164 Reviewed-on: https://chromium-review.googlesource.com/771381 Reviewed-by: Robbie Iannucci Commit-Queue: Andrii Shyshkalov --- recipes/recipe_modules/bot_update/__init__.py | 1 - recipes/recipe_modules/bot_update/api.py | 2 +- .../bot_update/resources/bot_update.py | 12 ++++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/recipes/recipe_modules/bot_update/__init__.py b/recipes/recipe_modules/bot_update/__init__.py index 45b59dd85a..e6a257881b 100644 --- a/recipes/recipe_modules/bot_update/__init__.py +++ b/recipes/recipe_modules/bot_update/__init__.py @@ -21,7 +21,6 @@ PROPERTIES = { # Gerrit patches will have all properties about them prefixed with patch_. 'patch_issue': Property(default=None), # TODO(tandrii): add kind=int. 'patch_set': Property(default=None), # TODO(tandrii): add kind=int. - 'patch_project': Property(default=None), # Also used by Rietveld. 'patch_gerrit_url': Property(default=None), 'patch_repository_url': Property(default=None), 'patch_ref': Property(default=None), diff --git a/recipes/recipe_modules/bot_update/api.py b/recipes/recipe_modules/bot_update/api.py index 857bcb1108..194c15c82b 100644 --- a/recipes/recipe_modules/bot_update/api.py +++ b/recipes/recipe_modules/bot_update/api.py @@ -10,7 +10,7 @@ from recipe_engine import recipe_api class BotUpdateApi(recipe_api.RecipeApi): - def __init__(self, issue, patch_issue, patchset, patch_set, patch_project, + def __init__(self, issue, patch_issue, patchset, patch_set, repository, patch_repository_url, gerrit_ref, patch_ref, patch_gerrit_url, rietveld, revision, parent_got_revision, deps_revision_overrides, fail_patch, *args, **kwargs): diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index dca3b1e757..3b4d3e40af 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -379,12 +379,12 @@ def normalize_git_url(url): if not p.netloc.endswith('.googlesource.com'): # Not a googlesource.com URL, can't normalize this, just return as is. return url - path = p.path - if path.startswith('/a'): - path = path[len('/a'):] - if path.endswith('.git'): - path = path[:-len('.git')] - return 'https://%s%s' % (p.netloc, path) + upath = p.path + if upath.startswith('/a'): + upath = upath[len('/a'):] + if upath.endswith('.git'): + upath = upath[:-len('.git')] + return 'https://%s%s' % (p.netloc, upath) # TODO(hinoka): Remove this once all downstream recipes stop using this format.