You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Dinesh Bhoopathy (JIRA)" <ji...@apache.org> on 2014/01/03 08:29:52 UTC

[jira] [Commented] (LIBCLOUD-484) HostVirtualException when calling list_records() on DNS driver

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

Dinesh Bhoopathy commented on LIBCLOUD-484:
-------------------------------------------

Ah, appears this is failing for two reasons,

- It should be "id" instead of "zone_id" @tomaz, you were right about the id
- The driver is trying make a GET call by passing the params in json like you'd do in POST

Working on the fix now. I'll submit a pull request after running the tests.

> HostVirtualException when calling list_records() on DNS driver
> --------------------------------------------------------------
>
>                 Key: LIBCLOUD-484
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-484
>             Project: Libcloud
>          Issue Type: Bug
>            Reporter: Andrew Udvare
>
> Calling {{list_records()}} on the DNS Driver object does not seem to work. The shortcut on the {{Zone}} object is also affected.
> {noformat}
>     # Standard initialisation code here
>     zones = dns_driver.list_zones()  # Successful
>     pp(zones[0].list_records())  # Fails
> {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=...'
> # -------- 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}



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