Merge pull request #15479 from NissimHadar/22415-fixBackTraceUploadFailures

Case 22145: Fix BackTrace upload failures
This commit is contained in:
NissimHadar 2019-05-01 11:47:05 -07:00 committed by GitHub
commit bf24a083fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,36 @@
# Parameters:
# 1 - $BACKTRACE_UPLOAD_TOKEN
# 2 - $SYMBOLS_ARCHIVE
# 3 - $RELEASE_NUMBER
#
import sys
import urllib.request
import urllib.parse
print("Running python script to upload to BackTrace")
post_headers = {}
post_headers['Content-Type'] = 'application/json'
post_headers['Expect'] = ''
post_url = 'https://highfidelity.sp.backtrace.io:6098/post?format=symbols&token=' + sys.argv[1] + '&upload_file=' + sys.argv[2] + '&tag=' + sys.argv[3]
try:
post_data = open(sys.argv[2], 'rb')
except:
print('file ' + sys.argv[2] + ' not found')
exit(1)
try:
post_request = urllib.request.Request(post_url, post_data, post_headers)
except:
print('urllib.request.Request failed')
exit(1)
try:
post_response = urllib.request.urlopen(post_request)
except:
print('urllib.request.urlopen failed')
exit(1)
print("Upload to BackTrace completed without errors")