Improve Sky Hub error handling (#5762)

* Added error handling in function _get_skyhub_data

* Error line split for readability
This commit is contained in:
Alessandro Mogavero 2017-02-07 08:28:33 +00:00 committed by Paulus Schoutsen
parent 48161697f8
commit 86da4f511d

View File

@ -111,6 +111,9 @@ def _get_skyhub_data(url):
def _parse_skyhub_response(data_str):
"""Parse the Sky Hub data format."""
pattmatch = re.search('attach_dev = \'(.*)\'', data_str)
if pattmatch is None:
raise IOError('Error: Impossible to fetch data from' +
' Sky Hub. Try to reboot the rooter.')
patt = pattmatch.group(1)
dev = [patt1.split(',') for patt1 in patt.split('<lf>')]