简体   繁体   English

Apache libcloud,dns和godaddy-名称或服务未知

[英]Apache libcloud, dns, and godaddy - Name or service not known

Using that apache libloud docs and valid credentials i get the below error trying to list domains on godaddy. 使用该Apache libloud文档和有效的凭证,我在尝试在godaddy上列出域时遇到以下错误。 Does libcloud noi longer support godaddy? libcloud noi不再支持Godaddy吗?

>>> from libcloud.dns.types import Provider
>>> from libcloud.dns.providers import get_driver
>>> cls = get_driver(Provider.GODADDY)
>>> driver = cls('twst', 'adfadf', 'dsdfsdf')
>>> zones = driver.list_zones()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/libcloud/dns/drivers/godaddy.py", line 146, in list_zones
    '/v1/domains/').object
  File "/usr/local/lib/python2.7/dist-packages/libcloud/common/base.py", line 782, in request
    headers=headers)
  File "/usr/lib/python2.7/httplib.py", line 979, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1013, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 835, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 797, in send
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/libcloud/httplib_ssl.py", line 266, in connect
    self.timeout)
  File "/usr/lib/python2.7/socket.py", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known
>>> 

It looks like there was a bug in the driver. 看起来驱动程序中有错误。 The "host" attribute on the connection class was incorrectly set to a URL instead of a hostname. 连接类上的“主机”属性被错误地设置为URL而不是主机名。

I pushed a fix for that - https://github.com/apache/libcloud/commit/a3ba6a4751623224f16175df9175ec06b29cdc1a 我为此推送了一个修复程序-https: //github.com/apache/libcloud/commit/a3ba6a4751623224f16175df9175ec06b29cdc1a

You can test this change by installing latest in development version from git using pip - pip install git+https://git-wip-us.apache.org/repos/asf/libcloud.git@trunk#egg=apache-libcloud 您可以通过使用pip从git安装最新的开发版本来测试此更改pip install git+https://git-wip-us.apache.org/repos/asf/libcloud.git@trunk#egg=apache-libcloud

I have confirmed the change is working locally, but if you encounter any more issues, please let us know. 我已经确认此更改在本地有效,但是如果您遇到其他问题,请告诉我们。

from libcloud.dns.types import Provider
from libcloud.dns.providers import get_driver
cls = get_driver(Provider.GODADDY)
driver = cls('twst', 'adfadf', 'dsdfsdf')
print driver.list_zones()
...
libcloud.dns.drivers.godaddy.GoDaddyDNSException: <GoDaddyDNSException in MALFORMED_API_KEY: Malformed API key>

In addition to that, I will also go ahead and push a change so a more friendly exception is thrown in case the "host" attribute is set to a value which is not a hostname. 除此之外,我还将继续进行更改,以便在“主机”属性设置为非主机名的值时引发更友好的异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM