Skip to content
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

Fix stripping of extraneous fields since totalEntries now appears first in the JSON #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cjwbath
Copy link

@cjwbath cjwbath commented Jan 10, 2022

Rackspace appear to have changed the order of fields in the JSON responses so totalEntries field now appears before record, e.g.
{"totalEntries":XX,"records":[{"id":"aaaaaaaaa-aaaaaaaaaa-aaaaaaaa","name":"example.com","type":"A","data":"10.1.1.1","ttl":3600,"updated":"2021-12-13T10:47:23.239Z","created":"2021-10-28T15:29:46.763Z"},...]}

The existing code scripts used in get_domains and get_records then fail to strip the field names properly when processing the data. In the case of get_records this causes the very first record to be mangled - the extra comma that remains confuses AWK column selection.

This is a quick fudge to make it work again. There is probably a more elegant way to fix it once and for all if field order changes again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant