get_latest_release might fail if network is down
This commit is contained in:
parent
ed8e71e5c6
commit
c0ce0a556a
1 changed files with 10 additions and 7 deletions
|
@ -96,13 +96,16 @@ def current_version(module):
|
|||
return version
|
||||
|
||||
def get_latest_release():
|
||||
release_data = get(settings.server.get('release_url'))
|
||||
release = json.loads(release_data.decode('utf-8'))
|
||||
if verify(release):
|
||||
ox.makedirs(settings.updates_path)
|
||||
with open(os.path.join(settings.updates_path, 'release.json'), 'wb') as fd:
|
||||
fd.write(release_data)
|
||||
return release
|
||||
try:
|
||||
release_data = get(settings.server.get('release_url'))
|
||||
release = json.loads(release_data.decode('utf-8'))
|
||||
if verify(release):
|
||||
ox.makedirs(settings.updates_path)
|
||||
with open(os.path.join(settings.updates_path, 'release.json'), 'wb') as fd:
|
||||
fd.write(release_data)
|
||||
return release
|
||||
except:
|
||||
logger.debug('failed get latest release')
|
||||
|
||||
def get_platform():
|
||||
name = sys.platform
|
||||
|
|
Loading…
Reference in a new issue