hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject hbase git commit: HBASE-19032 Set mimetype for patches uploaded by submit-patch.py
Date Tue, 17 Oct 2017 22:45:36 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 9edc26767 -> 80c14c9b7


HBASE-19032 Set mimetype for patches uploaded by submit-patch.py

Change-Id: I38e6417dddd4e2525cd6a929922b2612c91d660d


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/80c14c9b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/80c14c9b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/80c14c9b

Branch: refs/heads/branch-1.3
Commit: 80c14c9b702d9910de4641ff22b478ccbb1cadfd
Parents: 9edc267
Author: Apekshit Sharma <appy@apache.org>
Authored: Tue Oct 17 15:32:39 2017 -0700
Committer: Apekshit Sharma <appy@apache.org>
Committed: Tue Oct 17 15:45:27 2017 -0700

----------------------------------------------------------------------
 dev-support/submit-patch.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/80c14c9b/dev-support/submit-patch.py
----------------------------------------------------------------------
diff --git a/dev-support/submit-patch.py b/dev-support/submit-patch.py
index 577be52..ad39495 100755
--- a/dev-support/submit-patch.py
+++ b/dev-support/submit-patch.py
@@ -205,12 +205,12 @@ def get_credentials():
     return creds
 
 
-def attach_patch_to_jira(issue_url, patch_filepath, creds):
+def attach_patch_to_jira(issue_url, patch_filepath, patch_filename, creds):
     # Upload patch to jira using REST API.
     headers = {'X-Atlassian-Token': 'no-check'}
-    files = {'file': open(patch_filepath, 'rb')}
+    files = {'file': (patch_filename, open(patch_filepath, 'rb'), 'text/plain')}
     jira_auth = requests.auth.HTTPBasicAuth(creds['jira_username'], creds['jira_password'])
-    attachment_url = issue_url +  "/attachments"
+    attachment_url = issue_url + "/attachments"
     r = requests.post(attachment_url, headers = headers, files = files, auth = jira_auth)
     assert_status_code(r, 200, "uploading patch to jira")
 
@@ -256,7 +256,7 @@ if args.jira_id is not None:
     creds = get_credentials()
     issue_url = "https://issues.apache.org/jira/rest/api/2/issue/" + args.jira_id
 
-    attach_patch_to_jira(issue_url, patch_filepath, creds)
+    attach_patch_to_jira(issue_url, patch_filepath, patch_filename, creds)
 
     if not args.skip_review_board:
         rb_auth = requests.auth.HTTPBasicAuth(creds['rb_username'], creds['rb_password'])


Mime
View raw message