-
Notifications
You must be signed in to change notification settings - Fork 924
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
Register priority for MX records #718
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.