IPResolver: fix unreachable code (#3267)
* Fix unreachable code _get_aws_ip_ranges handles missing file exceptions and returns None, so the excepttion handling block in the UpdateIPRange thread is never reached. * Test for missing range file in resolver thread
This commit is contained in:
parent
0f1d415c49
commit
fc67bbd0a6
2 changed files with 14 additions and 5 deletions
|
@ -211,10 +211,9 @@ class _UpdateIPRange(Thread):
|
|||
|
||||
def run(self):
|
||||
while True:
|
||||
try:
|
||||
logger.debug('Updating aws ip range from "%s"', 'util/ipresolver/aws-ip-ranges.json')
|
||||
aws_ip_range_json = _get_aws_ip_ranges()
|
||||
except:
|
||||
logger.debug('Updating aws ip range from "%s"', 'util/ipresolver/aws-ip-ranges.json')
|
||||
aws_ip_range_json = _get_aws_ip_ranges()
|
||||
if aws_ip_range_json is None:
|
||||
logger.exception('Failed trying to update aws ip range')
|
||||
time.sleep(_FAILED_UPDATE_RETRY_SECS)
|
||||
continue
|
||||
|
|
Reference in a new issue