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

GoDaddy listing records fails if given --content option #1538

Open
dmeranda opened this issue Jan 20, 2023 · 0 comments
Open

GoDaddy listing records fails if given --content option #1538

dmeranda opened this issue Jan 20, 2023 · 0 comments

Comments

@dmeranda
Copy link

Using Lexicon 3.11.7

When using the godaddy provider and listing records, if the content filter option is given then a Python exception is raised.

I believe it is trying to access the wrong member of a dictionary of godaddy.py line 85:

records = [record for record in records if record["data"] == content]

rather than

records = [record for record in records if record["content"] == content]

Invoking as:

lexicon godaddy list example.com A --name test.example.com --content 10.1.2.3

the stack trace is:

Traceback (most recent call last):
  File "/usr/local/bin/lexicon", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/lexicon/cli.py", line 131, in main
    results = client.execute()
  File "/usr/local/lib/python3.8/dist-packages/lexicon/client.py", line 93, in execute
    return self.provider.list_records(record_type, name, content)
  File "/usr/local/lib/python3.8/dist-packages/lexicon/providers/base.py", line 92, in list_records
    return self._list_records(rtype=rtype, name=name, content=content)
  File "/usr/local/lib/python3.8/dist-packages/lexicon/providers/godaddy.py", line 85, in _list_records
    records = [record for record in records if record["data"] == content]
  File "/usr/local/lib/python3.8/dist-packages/lexicon/providers/godaddy.py", line 85, in <listcomp>
    records = [record for record in records if record["data"] == content]
KeyError: 'data'
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

No branches or pull requests

1 participant