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

John Carr commented on LIBCLOUD-288:
------------------------------------

Here is what it looks like for Gandi.

https://github.com/apache/libcloud/pull/92

The core bit of the patch is actually tiny - less than 80 lines. Check out 
libcloud/common/gandi.py. This makes full use of the xmlrpclib marshaller and 
demarshaller, but the actual post is done by libcloud. The API is much more 
typical for a libcloud driver than before - with the calls returning a Response 
object.

I believe this is in a state where it could be reviewed and merged.

As a follow up (and part of this ticket) I will pull the common parts of this 
code into libcloud/common/xmlrpclib.py and update the VCL and SoftLayer drivers 
to use it (I would prefer to land this and ticket 287 first, though). Both 
Gandi and SoftLayer prefix their calls (for example, if you pass True to a 
Gandi method, the driver actually sends secretKey, True. To support that i'll 
add a pre_rpc_hook method to a XMLRPCConnection base class. VCL adds extra 
headers to the http requests, these are supported by the existing 
pre_connect_hook.

For mapping xmlrpc faults to specific libcloud exceptions i'll use something 
like the error handler in AWS - a mapping of fault codes to exception classes, 
plus a way to pass parameters to those exceptions using data in the context 
object. I might even be able to pull part of the AWS generic error out as a 
mixin.
                
> Update libcloud xmlrpclib drivers to make better use of libcloud http layer
> ---------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-288
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-288
>             Project: Libcloud
>          Issue Type: Bug
>            Reporter: John Carr
>
> Right now the xmlrpclib drivers make their own http calls and bypass any of 
> the nice features in libcloud httplib wrappers. For example, LIBCLOUD_DEBUG 
> doesn't work for xmlrpc drivers.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to