You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2019/01/16 08:28:42 UTC
[hbase] branch branch-2 updated: HBASE-21712 : Make submit-patch.py
python3 compatible
This is an automated email from the ASF dual-hosted git repository.
psomogyi pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new 49e7e27 HBASE-21712 : Make submit-patch.py python3 compatible
49e7e27 is described below
commit 49e7e2746736cd20bae0fdd5d68f50851d0a1278
Author: Tommy Li <To...@microsoft.com>
AuthorDate: Mon Jan 14 14:29:52 2019 -0800
HBASE-21712 : Make submit-patch.py python3 compatible
Signed-off-by: Sergey Shelukhin <se...@apache.org>
---
.pylintrc | 3 +++
dev-support/python-requirements.txt | 1 +
dev-support/submit-patch.py | 7 ++++---
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/.pylintrc b/.pylintrc
index b43e363..9d79cc2 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -133,6 +133,9 @@ dummy-variables-rgx=_|dummy
# you should avoid to define new builtins when possible.
additional-builtins=
+# List of modules that can redefine builtins. (For python 2/3 compatibility)
+redefining-builtins-modules=builtins
+
[TYPECHECK]
diff --git a/dev-support/python-requirements.txt b/dev-support/python-requirements.txt
index e7fcf31..8ef693e 100644
--- a/dev-support/python-requirements.txt
+++ b/dev-support/python-requirements.txt
@@ -16,6 +16,7 @@
# limitations under the License.
#
requests
+future
gitpython
rbtools
jinja2
diff --git a/dev-support/submit-patch.py b/dev-support/submit-patch.py
index 352b1ba..8c52915 100755
--- a/dev-support/submit-patch.py
+++ b/dev-support/submit-patch.py
@@ -22,6 +22,7 @@
# are not updated. Review board id is retrieved from the remote link in the jira.
# Print help: submit-patch.py --h
import argparse
+from builtins import input, str
import getpass
import git
import json
@@ -146,7 +147,7 @@ def get_patch_name_with_version(patch_name_prefix):
if html.status_code != 200:
log_fatal_and_exit(" Cannot fetch jira information. Status code %s", html.status_code)
# Iterate over patch names starting from version 1 and return when name is not already used.
- content = unicode(html.content, 'utf-8')
+ content = str(html.content, 'utf-8')
for i in range(1, 1000):
name = patch_name_prefix + "." + ('{0:03d}'.format(i)) + ".patch"
if name not in content:
@@ -196,10 +197,10 @@ def get_credentials():
log_fatal_and_exit(" Couldn't decrypt ~/.apache-creds file. Exiting..")
creds = json.loads(content)
else:
- creds['jira_username'] = raw_input("Jira username:")
+ creds['jira_username'] = input("Jira username:")
creds['jira_password'] = getpass.getpass("Jira password:")
if not args.skip_review_board:
- creds['rb_username'] = raw_input("Review Board username:")
+ creds['rb_username'] = input("Review Board username:")
creds['rb_password'] = getpass.getpass("Review Board password:")
return creds