You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zone.example file:
@ IN SOA dns.example.com. admin.example.com. (
2010042671 ; serial
3600 ; refresh
1200 ; retry
86400 ; expire
360 ; minimum
)
@ NS dns
test A 127.0.0.1
test.py
#!/usr/bin/pythonimportdns.zone, dns.name, dns.rdtypesz=dns.zone.from_file('zone.example','example.com')
name=dns.name.from_text('test.example.com')
a=dns.rdtypes.IN.A.A(dns.rdataclass.IN, dns.rdatatype.A, '127.0.0.2')
z.replace_rdataset(name, a)
z.to_file('zone.output')
output:
Traceback (most recent call last):
File "./test.py", line 9, in
z.to_file('zone.output')
File "/usr/lib64/python2.7/site-packages/dns/zone.py", line 496, in to_file
relativize=relativize)
File "/usr/lib64/python2.7/site-packages/dns/node.py", line 52, in to_text
print >> s, rds.to_text(name, **kw)
TypeError: to_text() got multiple values for keyword argument 'origin'
The text was updated successfully, but these errors were encountered:
Chuangbo's comment is the right fix for your code. I will, however, change dnspython so that the parameters to replace_rdataset() are typechecked, as it ought to raise an error when you do the wrong thing instead of failing mysteriously later.
zone.example file:
@ IN SOA dns.example.com. admin.example.com. (
2010042671 ; serial
3600 ; refresh
1200 ; retry
86400 ; expire
360 ; minimum
)
@ NS dns
test A 127.0.0.1
test.py
output:
Traceback (most recent call last):
File "./test.py", line 9, in
z.to_file('zone.output')
File "/usr/lib64/python2.7/site-packages/dns/zone.py", line 496, in to_file
relativize=relativize)
File "/usr/lib64/python2.7/site-packages/dns/node.py", line 52, in to_text
print >> s, rds.to_text(name, **kw)
TypeError: to_text() got multiple values for keyword argument 'origin'
The text was updated successfully, but these errors were encountered: