From 1b918ee5338e0270370653a22542e6832e849459 Mon Sep 17 00:00:00 2001 From: Apekshit Sharma Date: Tue, 17 Oct 2017 15:32:39 -0700 Subject: [PATCH] HBASE-19032 Set Content-Type header for patches uploaded by submit-patch.py Change-Id: I38e6417dddd4e2525cd6a929922b2612c91d660d --- dev-support/submit-patch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev-support/submit-patch.py b/dev-support/submit-patch.py index 577be52472..ad3949530e 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']) -- 2.14.1