Conversation
As is, this fails to split out the priority value from the raw record value, resulting in a key error for missing priority when trying to export in BIND format. This is the quick hack I did to get the function to return a more useful Record.
|
Thanks for the contribution. |
| value = record['value'] | ||
| if record['type'] == 'MX': | ||
| extras['priority'] = record['value'].split(' ')[0] | ||
| value = record['value'].split(' ')[1] |
There was a problem hiding this comment.
Just curious why you split the value here and take the second (and not the first item) - it would help if I could see how the value looks like :)
There was a problem hiding this comment.
record['value'] looks like 15 aspmx.l.google.com - I didn't try it, but I expect leaving the value as that raw value would spit out ...15 15 aspmx... when converted to BIND speak.
Given that I don't have an exhaustive knowledge of DNS record types off the top of my head (or how Gandi returns them all), I expect this is an incomplete patch that happened to work for the (or my) Gandi MX case. I'm not sure how your team prefers to handle that, but I did want it to at least start on the way in so folks (or just me) don't have to monkey patch locally.
There was a problem hiding this comment.
That's for clarifying it.
This does indeed seem like a bug / inconsistency in the Gandi driver. value attribute should indeed only contain the value and the priority should be stored in extra.
|
Test case for |
As is, this fails to split out the priority value from the raw record value, resulting in a key error for missing priority when trying to export in BIND format. This is the quick hack I did to get the function to return a more useful Record.