Registering a third party driver

Driver is considered third party if it’s not bundled with a Libcloud release.

To register a third party driver you should use provider.set_driver()function from the corresponding component.

set_driver() takes the following arguments:

  1. set_driver('provider_name', 'path.to.the.module', 'DriverClass')

Keep in mind that the provider_name needs to be unique and this functionneeds to be called before using a third party driver.

For example:

  1. from libcloud.compute.providers import get_driver
  2. from libcloud.compute.providers import set_driver
  3.  
  4.  
  5. set_driver('stratuslab',
  6. 'stratuslab.libcloud.stratuslab_driver',
  7. 'StratusLabNodeDriver')
  8.  
  9. # Your code which uses the driver.
  10. # For example:
  11. driver = get_driver('stratuslab')

An example of an existing third party driver can be found athttps://github.com/StratusLab/libcloud-drivers