Merge pull request #3066 from quay/ipresolver-bug
Missing parens on IP resolver lookup
This commit is contained in:
commit
f0ec26ea54
1 changed files with 4 additions and 2 deletions
|
@ -78,13 +78,15 @@ class IPResolver(IPResolverInterface):
|
|||
logger.debug('Got non-200 response for IP %s: %s', ip_address, r.status_code)
|
||||
return False
|
||||
|
||||
logger.debug('Got IP data for IP %s: %s => %s', ip_address, r.status_code, r.json)
|
||||
threat_data = r.json.get('threat', {})
|
||||
logger.debug('Got IP data for IP %s: %s => %s', ip_address, r.status_code, r.json())
|
||||
threat_data = r.json().get('threat', {})
|
||||
return threat_data.get('is_threat', False) or threat_data.get('is_bogon', False)
|
||||
except requests.RequestException:
|
||||
logger.exception('Got exception when trying to lookup IP Address')
|
||||
except ValueError:
|
||||
logger.exception('Got exception when trying to lookup IP Address')
|
||||
except Exception:
|
||||
logger.exception('Got exception when trying to lookup IP Address')
|
||||
|
||||
return False
|
||||
|
||||
|
|
Reference in a new issue