server: disable extraneous HTTP errors in upload_apk_to_virustotal

This should be in the lowest level so that both the low level call,
upload_apk_to_virustotal(), and the next level up, upload_to_virustotal(),
both inherit this.
This commit is contained in:
Hans-Christoph Steiner 2020-05-13 22:21:46 +02:00
parent cfa88a5335
commit 77367f1bff

View file

@ -512,9 +512,6 @@ def upload_to_virustotal(repo_section, virustotal_apikey):
import requests import requests
requests # stop unused import warning requests # stop unused import warning
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("requests").setLevel(logging.WARNING)
if repo_section == 'repo': if repo_section == 'repo':
if not os.path.exists('virustotal'): if not os.path.exists('virustotal'):
os.mkdir('virustotal') os.mkdir('virustotal')
@ -534,6 +531,9 @@ def upload_apk_to_virustotal(virustotal_apikey, packageName, apkName, hash,
versionCode, **kwargs): versionCode, **kwargs):
import requests import requests
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("requests").setLevel(logging.WARNING)
outputfilename = os.path.join('virustotal', outputfilename = os.path.join('virustotal',
packageName + '_' + str(versionCode) packageName + '_' + str(versionCode)
+ '_' + hash + '.json') + '_' + hash + '.json')