libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Udvare (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LIBCLOUD-483) HostVirtual DNS Driver uses incorrect URL https://True:443/...
Date Mon, 30 Dec 2013 18:01:55 GMT

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

Andrew Udvare edited comment on LIBCLOUD-483 at 12/30/13 6:00 PM:
------------------------------------------------------------------

The {{list_records()}} on the {{Zone}} object does not seem to work for me.

Code is same as above, but with this change at the end:

{noformat}
    zones = dns_driver.list_zones()
    pp(zones[0].list_records())
{noformat}

Output:
{noformat}
# -------- begin 19615824 request ----------
curl -i -X GET -H 'Host: www.vr.org' -H 'X-LC-Request-ID: 19615824' -H 'Content-Length: 20'
-H 'Accept-Encoding: gzip,deflate' -H 'User-Agent: libcloud/0.13.2 (Host Virtual DNS) ' --data-binary
'{"zone_id": "26102"}' --compress 'https://www.vr.org:443/vapi/dns/records/?key=3abf6jYYkLQ-lKWj7ws.7uVQ0qJ6%5Er1QRF4YWmbelJOB%5EkX8yqJPXZq54Ilk759Z'
# -------- begin 19615824:19615968 response ----------
HTTP/1.1 412 Precondition Failed
Content-Length: 114
Content-Language: en-US
X-Powered-By: Host Virtual, Inc v2.1.5
Expires: 0
Server: Apache
Cache-Control: no-cache, must-revalidate
Date: Mon, 30 Dec 2013 17:57:42 GMT
Content-Type: application/json


{
  "error": {
    "code": 412,
    "message": "Precondition Failed: id, validate_required, Field required"
  }
}
# -------- end 19615824:19615968 response ----------

Traceback (most recent call last):
  File "/home/tatsh/usr/bin/vr-test", line 20, in <module>
    zones[0].list_records()
  File "/usr/lib64/python2.7/site-packages/libcloud/dns/base.py", line 59, in list_records
    return self.driver.list_records(zone=self)
  File "/usr/lib64/python2.7/site-packages/libcloud/dns/drivers/hostvirtual.py", line 115,
in list_records
    API_ROOT + '/dns/records/', data=json.dumps(params)).object
  File "/usr/lib64/python2.7/site-packages/libcloud/common/base.py", line 640, in request
    connection=self)
  File "/usr/lib64/python2.7/site-packages/libcloud/common/base.py", line 99, in __init__
    raise Exception(self.parse_error())
  File "/usr/lib64/python2.7/site-packages/libcloud/dns/drivers/hostvirtual.py", line 49,
in parse_error
    super(HostVirtualDNSResponse, self).parse_error()
  File "/usr/lib64/python2.7/site-packages/libcloud/common/hostvirtual.py", line 67, in parse_error
    data['error']['code'], data['error']['message'])
libcloud.common.hostvirtual.HostVirtualException: <HostVirtualException in 412: Precondition
Failed: id, validate_required, Field required>
{noformat}


was (Author: audvare):
The {{list_records()}} on the {{Zone}} object does not seem to work for me.

Code is same as above, but with this change at the end:

{{noformat}}
    zones = dns_driver.list_zones()
    pp(zones[0].list_records())
{{noformat}}

Output:
{{noformat}}
# -------- begin 19615824 request ----------
curl -i -X GET -H 'Host: www.vr.org' -H 'X-LC-Request-ID: 19615824' -H 'Content-Length: 20'
-H 'Accept-Encoding: gzip,deflate' -H 'User-Agent: libcloud/0.13.2 (Host Virtual DNS) ' --data-binary
'{"zone_id": "26102"}' --compress 'https://www.vr.org:443/vapi/dns/records/?key=3abf6jYYkLQ-lKWj7ws.7uVQ0qJ6%5Er1QRF4YWmbelJOB%5EkX8yqJPXZq54Ilk759Z'
# -------- begin 19615824:19615968 response ----------
HTTP/1.1 412 Precondition Failed
Content-Length: 114
Content-Language: en-US
X-Powered-By: Host Virtual, Inc v2.1.5
Expires: 0
Server: Apache
Cache-Control: no-cache, must-revalidate
Date: Mon, 30 Dec 2013 17:57:42 GMT
Content-Type: application/json


{
  "error": {
    "code": 412,
    "message": "Precondition Failed: id, validate_required, Field required"
  }
}
# -------- end 19615824:19615968 response ----------

Traceback (most recent call last):
  File "/home/tatsh/usr/bin/vr-test", line 20, in <module>
    zones[0].list_records()
  File "/usr/lib64/python2.7/site-packages/libcloud/dns/base.py", line 59, in list_records
    return self.driver.list_records(zone=self)
  File "/usr/lib64/python2.7/site-packages/libcloud/dns/drivers/hostvirtual.py", line 115,
in list_records
    API_ROOT + '/dns/records/', data=json.dumps(params)).object
  File "/usr/lib64/python2.7/site-packages/libcloud/common/base.py", line 640, in request
    connection=self)
  File "/usr/lib64/python2.7/site-packages/libcloud/common/base.py", line 99, in __init__
    raise Exception(self.parse_error())
  File "/usr/lib64/python2.7/site-packages/libcloud/dns/drivers/hostvirtual.py", line 49,
in parse_error
    super(HostVirtualDNSResponse, self).parse_error()
  File "/usr/lib64/python2.7/site-packages/libcloud/common/hostvirtual.py", line 67, in parse_error
    data['error']['code'], data['error']['message'])
libcloud.common.hostvirtual.HostVirtualException: <HostVirtualException in 412: Precondition
Failed: id, validate_required, Field required>
{{noformat}}

> 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)

Mime
View raw message