octodns / octodns-ns1

Ns1Provider provider for octoDNS
MIT License
4 stars 13 forks source link

Make sure geo is truthy, not just present #46

Closed ross closed 1 year ago

ross commented 1 year ago

_params_for_A was mistakenly looking for only the presence of .geo and its truthiness. It'll always be present on A and AAAA records, but only truthy when geo functionality is used. It just so happens that _params_for_geo_A returned valid params for the case when there were no geos so things worked. That said it returned extra information and was confusing and not the intended/expected flow.

This fixes that issue and checks that geo is present and truthy before using that path.

This was found while digging into hiccups in https://github.com/octodns/octodns-ns1/pull/45. The test side of things will change slightly back towards what I'm removing here, but that's fine and it's cleaner to fix things standalone in main before that change lands.

/cc https://github.com/octodns/octodns-ns1/pull/45#discussion_r1157730933 @viranch