Convert some 'str' arguments to 'dns.name.Name' #1

Open
jeltz wants to merge 1 commits from str_to_dns_name into master
jeltz commented 2 years ago
Collaborator

It seems to be required by dnspython.

Otherwise I get the following error message:

Traceback (most recent call last):
  File "/aurore/dns-ansible/main.py", line 201, in <module>
    exit(main())
  File "/aurore/dns-ansible/main.py", line 193, in main
    dataset.add(record.dns_rdata)
  File "/usr/lib/python3/dist-packages/dns/rdataset.py", line 126, in add
    super().add(rd)
  File "/usr/lib/python3/dist-packages/dns/set.py", line 56, in add
    if item not in self.items:
  File "/usr/lib/python3/dist-packages/dns/rdata.py", line 293, in __hash__
    return hash(self.to_digestable(dns.name.root))
  File "/usr/lib/python3/dist-packages/dns/rdata.py", line 221, in to_digestable
    return self.to_wire(origin=origin, canonicalize=True)
  File "/usr/lib/python3/dist-packages/dns/rdata.py", line 203, in to_wire
    self._to_wire(f, compress, origin, canonicalize)
  File "/usr/lib/python3/dist-packages/dns/rdtypes/nsbase.py", line 47, in _to_wire
    self.target.to_wire(file, compress, origin, canonicalize)
AttributeError: 'str' object has no attribute 'to_wire'
It seems to be required by dnspython. Otherwise I get the following error message: ``` Traceback (most recent call last): File "/aurore/dns-ansible/main.py", line 201, in <module> exit(main()) File "/aurore/dns-ansible/main.py", line 193, in main dataset.add(record.dns_rdata) File "/usr/lib/python3/dist-packages/dns/rdataset.py", line 126, in add super().add(rd) File "/usr/lib/python3/dist-packages/dns/set.py", line 56, in add if item not in self.items: File "/usr/lib/python3/dist-packages/dns/rdata.py", line 293, in __hash__ return hash(self.to_digestable(dns.name.root)) File "/usr/lib/python3/dist-packages/dns/rdata.py", line 221, in to_digestable return self.to_wire(origin=origin, canonicalize=True) File "/usr/lib/python3/dist-packages/dns/rdata.py", line 203, in to_wire self._to_wire(f, compress, origin, canonicalize) File "/usr/lib/python3/dist-packages/dns/rdtypes/nsbase.py", line 47, in _to_wire self.target.to_wire(file, compress, origin, canonicalize) AttributeError: 'str' object has no attribute 'to_wire'
jeltz added 1 commit 2 years ago
220f268fef
Convert some 'str' arguments to 'dns.name.Name'
It seems to be required by dnspython.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b str_to_dns_name master
git pull origin str_to_dns_name

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff str_to_dns_name
git push origin master
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: v-lafeychine/dns-ansible#1
Loading…
There is no content yet.