You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Tomaz Muraus (JIRA)" <ji...@apache.org> on 2013/12/30 14:04:50 UTC

[jira] [Commented] (LIBCLOUD-483) HostVirtual DNS Driver uses incorrect URL https://True:443/...

    [ https://issues.apache.org/jira/browse/LIBCLOUD-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13858772#comment-13858772 ] 

Tomaz Muraus commented on LIBCLOUD-483:
---------------------------------------

Looking at the source code, it seems like a HostVirtual drivers only take a single argument - "key" which represents an API key.

Correct usage would be:

{code}
dns_driver = _(settings['key'])
{code}

I'll add some documentation which explains how to use the driver and modify the code to throw if you pass in invalid arguments (this currently doesn't happen which causes for a bad user experience).

> HostVirtual DNS Driver uses incorrect URL https://True:443/...
> --------------------------------------------------------------
>
>                 Key: LIBCLOUD-483
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-483
>             Project: Libcloud
>          Issue Type: Bug
>    Affects Versions: 0.13.2
>            Reporter: Andrew Udvare
>
> Code is below:
> {noformat}
> #!/usr/bin/env python2
> from os.path import expanduser
> from pprint import pprint as pp
> import yaml
> from libcloud.dns.providers import get_driver as get_dns_driver
> from libcloud.dns.types import Provider as DNSProvider, RecordType
> if __name__ == '__main__':
>     with open(expanduser('~/.vr-api.yml')) as f:
>         settings = yaml.load(f.read())
>     _ = get_dns_driver(DNSProvider.HOSTVIRTUAL)
>     dns_driver = _(settings['user'], secret=settings['key'])
>     pp(dns_driver.list_zones())
> {noformat}
> Output with debug mode:
> {noformat}
> # -------- begin 24674600 request ----------
> curl -i -X GET -H 'Host: True' -H 'X-LC-Request-ID: 24674600' -H 'Accept-Encoding: gzip,deflate' -H 'User-Agent: libcloud/0.13.2 (Host Virtual DNS) ' --compress 'https://True:443/vapi/dns/zones/?key=xY.EQtns-X%5EBLatCf9BS58hqiv4ymAad9GNM0Zpp-jx2r%5EzzNgLHdjiqp4RS9fMF0HpBhVJkf%5E'
> Traceback (most recent call last):
>   File "/home/tatsh/usr/bin/vr-test", line 21, in <module>
>     pp(dns_driver.list_zones())
>   File "/usr/lib64/python2.7/site-packages/libcloud/dns/drivers/hostvirtual.py", line 107, in list_zones
>     API_ROOT + '/dns/zones/').object
>   File "/usr/lib64/python2.7/site-packages/libcloud/common/base.py", line 631, in request
>     headers=headers)
>   File "/usr/lib64/python2.7/site-packages/libcloud/common/base.py", line 364, in request
>     headers)
>   File "/usr/lib64/python2.7/httplib.py", line 973, in request
>     self._send_request(method, url, body, headers)
>   File "/usr/lib64/python2.7/httplib.py", line 1007, in _send_request
>     self.endheaders(body)
>   File "/usr/lib64/python2.7/httplib.py", line 969, in endheaders
>     self._send_output(message_body)
>   File "/usr/lib64/python2.7/httplib.py", line 829, in _send_output
>     self.send(msg)
>   File "/usr/lib64/python2.7/httplib.py", line 791, in send
>     self.connect()
>   File "/usr/lib64/python2.7/site-packages/libcloud/httplib_ssl.py", line 99, in connect
>     self.timeout)
>   File "/usr/lib64/python2.7/socket.py", line 553, in create_connection
>     for res in getaddrinfo(host, port, 0, SOCK_STREAM):
> TypeError: getaddrinfo() argument 1 must be string or None
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)