Comment 4 for bug 1058366

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/21901
Committed: http://github.com/openstack/python-novaclient/commit/c0e85a84b0ef60047f9435ef5035d0f65e446847
Submitter: Jenkins
Branch: master

commit c0e85a84b0ef60047f9435ef5035d0f65e446847
Author: David Scannell <email address hidden>
Date: Wed Feb 13 13:47:45 2013 -0500

    Allow extensions to provide a name when discovered on the python path.

    Using novaclient with some extensions via python code, you might have an
    invocation like this:

        extensions = shell.OpenStackComputeShell()._discover_extensions("1.1")
        novaclient = Client("1.1", user, apikey, project, authurl, extensions=extensions,
                            endpoint_type=shell.DEFAULT_NOVA_ENDPOINT_TYPE,
                            service_type=shell.DEFAULT_NOVA_SERVICE_TYPE)

    If you have an extension like 'myextension.py' in the v1_1/contrib directory, you'll
    end up with a very sensible attribute on the resulting novaclient object, i.e.

        novaclient.myextension

    If you have a package distributed in the package myextension_python_novaclient_ext,
    then it'll automatically be picked up as an extension (awesome!) but the name is not
    as intuitive.

        novaclient.myextension_python_novaclient_ext

    This patch simply changes this to allow the Extension to provide a name for itself.
    The possibility of collisions exists, but is not really any more significant than
    before (where you might have different versions of the same package installed in the
    system or heck, even a bizarrely named 'myextension_python_novaclient_ext.py' in the
    contrib/ directory).

    Fixes bug 1058366

    Change-Id: Ie68463ffd7a939744e035b20fd50a7dc8da605de