Я пытаюсь заставить работать скрипт для проверки / редактирования моего днс на transip. Это работает частично, пока я действительно не хочу что-то делать.
Текущий код:
#!/usr/bin/env python3
from transip.service.domain import DomainService
basedomain='gemert.net'
key='MY_KEY_IS_SECRET'
dnsservice = DomainService('MY_USERNAME', private_key=key)
print(dnsservice.get_domain_names())
print(dnsservice.check_availability(basedomain))
print(dnsservice.get_info(basedomain))
Результат при запуске выглядит следующим образом:
./setdns.py
[mydomain1.com, mydomain2.org, mydomain3.net]
inyouraccount
Traceback (most recent call last):
File "./setdns.py", line 49, in <module>
print(dnsservice.get_info(basedomain))
File "/usr/local/lib/python3.7/dist-packages/suds/__init__.py", line 166, in <lambda>
__str__ = lambda x: x.__unicode__()
File "/usr/local/lib/python3.7/dist-packages/suds/sudsobject.py", line 172, in __unicode__
return self.__printer__.tostr(self)
File "/usr/local/lib/python3.7/dist-packages/suds/sudsobject.py", line 256, in tostr
return self.process(object, history, indent)
File "/usr/local/lib/python3.7/dist-packages/suds/sudsobject.py", line 265, in process
return self.print_object(object, h, n+2, nl)
File "/usr/local/lib/python3.7/dist-packages/suds/sudsobject.py", line 312, in print_object
s.append(self.process(item[1], h, n, True))
File "/usr/local/lib/python3.7/dist-packages/suds/sudsobject.py", line 273, in process
return self.print_collection(object, h, n+2)
File "/usr/local/lib/python3.7/dist-packages/suds/sudsobject.py", line 352, in print_collection
s.append(self.process(item, h, n-2))
File "/usr/local/lib/python3.7/dist-packages/suds/sudsobject.py", line 265, in process
return self.print_object(object, h, n+2, nl)
File "/usr/local/lib/python3.7/dist-packages/suds/sudsobject.py", line 282, in print_object
if d in h:
File "/usr/local/lib/python3.7/dist-packages/transip/service/objects.py", line 57, in __eq__
return self.name == other.name and self.type == other.type and self.content == other.content
AttributeError: 'list' object has no attribute 'name'
Что я делаю неправильно? Первые две команды работают, но dnsservice.get_info(basedomain)
не работает
Версия transip module
pip3 show transip
Name: transip
Version: 2.0.0
Summary: TransIP API Connector
Home-page: https://github.com/benkonrath/transip-api
Author: Go About B.V.
Author-email: tech@goabout.com
License: MIT
Location: /usr/local/lib/python3.7/dist-packages
Requires: cryptography, suds-jurko, requests
Required-by: