-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipapi.com module #1138
ipapi.com module #1138
Conversation
Update - 30/9
Update master 16-01-2021
Co-authored-by: bcoles <bcoles@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1138 +/- ##
==========================================
- Coverage 50.78% 50.76% -0.02%
==========================================
Files 442 444 +2
Lines 35777 35892 +115
==========================================
+ Hits 18168 18220 +52
- Misses 17609 17672 +63
Continue to review full report at Codecov.
|
|
||
if self.opts['api_key'] == "": | ||
self.sf.error("You enabled sfp_ipapicom but did not set an API key!") | ||
self.errorState = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errorState is set but not checked.
modules/sfp_ipapicom.py
Outdated
|
||
if data.get('country_name'): | ||
location = ', '.join(filter(None, [data.get('city'), data.get('region_name'), data.get('region_code'), data.get('country_name'), data.get('country_code')])) | ||
location += f"\n-Latitude: {data.get('latitude')}\n-Longitude: {data.get('longitude')}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lat/Lon should be reported separately as PHYSICAL_COORDINATES
.
modules/sfp_ipapicom.py
Outdated
self.errorState = True | ||
return None | ||
|
||
if self.errorState: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check should be before the above if
block, since otherwise an error log will be generated for every event received.
No description provided.