Improve dashboard upload script so the errors are more understandable
No-Presubmit: True Bug: None Change-Id: I2bc297fddacd33037a7c77107d653da87dd2737e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195560 Commit-Queue: Andrey Logvin <landrey@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32715}
This commit is contained in:

committed by
Commit Bot

parent
cde4a9f669
commit
bcca3b08a9
@ -225,17 +225,17 @@ def UploadToDashboard(options):
|
|||||||
|
|
||||||
response, content = _SendHistogramSet(options.dashboard_url, histograms)
|
response, content = _SendHistogramSet(options.dashboard_url, histograms)
|
||||||
|
|
||||||
upload_token = json.loads(content).get('token')
|
if response.status != 200:
|
||||||
if not options.wait_for_upload or not upload_token:
|
|
||||||
print 'Not waiting for upload status confirmation.'
|
|
||||||
if response.status == 200:
|
|
||||||
print 'Received 200 from dashboard.'
|
|
||||||
return 0
|
|
||||||
else:
|
|
||||||
print('Upload failed with %d: %s\n\n%s' % (response.status,
|
print('Upload failed with %d: %s\n\n%s' % (response.status,
|
||||||
response.reason, content))
|
response.reason, content))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
upload_token = json.loads(content).get('token')
|
||||||
|
if not options.wait_for_upload or not upload_token:
|
||||||
|
print('Received 200 from dashboard. ',
|
||||||
|
'Not waiting for the upload status confirmation.')
|
||||||
|
return 0
|
||||||
|
|
||||||
response, resp_json = _WaitForUploadConfirmation(
|
response, resp_json = _WaitForUploadConfirmation(
|
||||||
options.dashboard_url,
|
options.dashboard_url,
|
||||||
upload_token,
|
upload_token,
|
||||||
@ -253,6 +253,6 @@ def UploadToDashboard(options):
|
|||||||
str(resp_json)))
|
str(resp_json)))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
print('Upload wasn\'t completed in a given time: %d seconds.',
|
print('Upload wasn\'t completed in a given time: %d seconds.' %
|
||||||
options.wait_timeout_sec)
|
options.wait_timeout_sec)
|
||||||
return 1
|
return 1
|
||||||
|
Reference in New Issue
Block a user