Changes in Apache Libcloud v2.0

    In 2.0 this implementation has been replaced with the requests package, and SSL verification should work against any publicly signed HTTPS endpoint by default, without having to provide a CA cert store.

    Other changes include:

    • Enabling HTTP redirects
    • Allowing both global and driver-specific HTTP proxy configuration
    • Consolidation of the LibcloudHTTPSConnection and LibcloudHTTPConnection into a single class, LibcloudConnection
    • Support for mocking HTTP responses without having to mock the Connection class
    • 10% typical performance improvement with the use of persistent TCP connections for each driver instance
    • Access to the low-level TCP session is no longer available. Access to .read() on a raw connection will bind around requests body or iter_content methods.
    • Temporary removal of the S3 very-large file support using the custom multi-part APIs. This will be added back in subsequent release candidates.

    HTTP redirects are allowed by default in 2.0. To disable redirects, set this global variable to False.

    Adding support for Python 3.6 and deprecation of Python 3.2

    In Apache Libcloud 2.0.0, Python 3.6 is as a primary distribution.

    Python 3.2 support has been dropped in this release and users should either upgrade to 3.3 or a newer version of Python.

    In Apache Libcloud 2.0.0, the Mozilla Trusted Root Store is bundled with the package, as part of the requests package bundle. This means that users no longer have to set the path to a CA file either via installing the certifi package, downloading a PEM file or providing a directory in an environment variable. All connections in Libcloud will assume HTTPS by default, now with 2.0.0, if those HTTPS endpoints have a signed certificate with a trusted CA authority, they will work with Libcloud by default.

    This code example would set a HTTP/HTTPS proxy and use a client-generated certificate to verify.

    In Apache Libcloud 2.0.0 if you provide a list of more than 1 path or certificate file in libcloud.security.CA_CERTS_PATH you will receive a warning and only the first path will be used. This path should be to a .cert or .pem file. The environment variable REQUESTS_CA_BUNDLE can be used to access the requests library’s list of trusted CAs.

    Performance improvements and introduction of sessions

    Each instance of libcloud.common.base.Connection will have a LibcloudConnection instance under the connection property. In 1.5.0<, there would be 2 connection class instances, LibcloudHttpConnection and LibcloudHttpsConnection, stored as an instance property conn_classes. In 2.0.0 this has been replaced with a single type, that handles both HTTP and HTTPS connections.

    The methods upload_object_via_stream now supports file objects, BytesIO, StringIO and generators as the iterator.

    Other minor changes

    • will now use urljoin to combine the request_path and method URLs. This means that the URL action will always have a leading slash.
    • The underlying connection classes do not assume HTTP if a non-standard port is used. They will use the preference set in the secure flag to the initializer of Connection.