Philip, My replies are in-line.
On Fri, Mar 7, 2014 at 12:39 PM, <[email protected]> wrote: > Hi all, > > I've been testing libcloud for the past couple of months against vCloud > Director working with colleagues to develop a cloud portal for the > environmental science research community in the UK. Our experience with > libcloud has been good so thank you for all the great work that has gone > into this package. > Great, glad that you find it useful. > > We started testing against version 1.5 of vCD but have migrated to 5.5. > In the case of the latter, we've been able to use the existing driver for > version 5.1 but there have been a couple of issues with some of the API > calls. For example, the explicitly setting the version 5.5 string in the > Accept header is needed in some cases. For the moment I've made a local > patch to libcloud.compute.drivers.vcloud modifying VCloudNodeDriver and > defining new 5.5 classes: > Yeah, adding a new class for API version 5.5 is the correct approach. > class VCloudNodeDriver(NodeDriver): > """ > vCloud node driver > """ > > . . . > > def __new__(cls, key, secret=None, secure=True, host=None, port=None, > api_version=DEFAULT_API_VERSION, **kwargs): > if cls is VCloudNodeDriver: > if api_version == '0.8': > cls = VCloudNodeDriver > elif api_version == '1.5': > cls = VCloud_1_5_NodeDriver > elif api_version == '5.1': > cls = VCloud_1_5_NodeDriver > elif api_version == '5.5': > cls = VCloud_5_5_NodeDriver > else: > raise NotImplementedError( > "No VCloudNodeDriver found for API version %s" % > (api_version)) > return super(VCloudNodeDriver, cls).__new__(cls) > > . . . > > class VCloud_5_5_Connection(VCloud_1_5_Connection): > def add_default_headers(self, headers): > headers['Accept'] = 'application/*+xml;version=5.5' > headers['x-vcloud-authorization'] = self.token > return headers > > . . . > > class VCloud_5_5_NodeDriver(VCloud_5_1_NodeDriver): > '''Use 5.5 Connection class to explicitly set 5.5 for the version in > Accept headers > ''' > connectionCls = VCloud_5_5_Connection > > > We'd like to contribute a version 5.5 driver to the code base as I think > we're likely to come across further wrinkles as we explore more of the > functionality of the libcloud vCD driver. > > We're also likely to want to make use of external cloud providers for our > system so some of the other drivers are useful to us. Unfortunately to > make connections outside from our site here we need to run through a proxy > for both HTTP and HTTPS. Again I've made a patch for this as the current > code doesn't seem to support this. > > What would be the best way to contribute code back? Could we fork the git > repository and request any of our contributions be merged in? > Great! We would love to have both of those changes in trunk. The best way to contribute is to fork our Git / Github repository, open a pull request (https://github.com/apache/libcloud) and we will go from there. You might also find this link useful - https://libcloud.readthedocs.org/en/latest/development.html#contributing If you have any questions or need help, let us know. > Thanks, > Phil-- > Scanned by iCritical. >
