Merge pull request #225 from jwendell/apt-406

apt_proxy: Also consider http error code 406
This commit is contained in:
Anders Ingemann 2015-06-10 21:53:55 +02:00
commit 0351e0e493

View file

@ -18,7 +18,7 @@ class CheckAptProxy(Task):
urllib2.urlopen(proxy_url, timeout=5)
except Exception as e:
# Default response from `apt-cacher-ng`
if isinstance(e, urllib2.HTTPError) and e.code == 404 and e.msg == 'Usage Information':
if isinstance(e, urllib2.HTTPError) and e.code in [404, 406] and e.msg == 'Usage Information':
pass
else:
import logging