Conversation
geobox.py
Outdated
| feed += entry['prefix'] + ',' + country + ',' + region + ',' + city + ',\n' | ||
| i += 1 | ||
|
|
||
| elif fields['geoloc_has_location'] == None: |
There was a problem hiding this comment.
Yes, if you have a fresh install and an empty netbox when you install the plugin. If, like me, your netbox is already full, the prefixes are not completed with the info geloloc true or false. As a consequence, they have a null value
There was a problem hiding this comment.
Ah, that makes sense. IMO it would make more sense to trigger the logic for when has_location is true when a null value is encountered, so the prefix inherits its parent's geoloc (covered by the check if all location values are null).
The check highlighted here should still be changed to check for false (or just a simple else if null means inheriting), since there is currently no way to specify that a prefix has no location (which is what the ,,,, line is exclusively for).

modify script to output only geoloc = True and None