extending python-neutronclient commands with an external module fails

Bug #1430825 reported by Mathieu Rohon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Fix Released
High
Mathieu Rohon

Bug Description

The framework to extend python-neutronclient with commands provided by an external module has merged with the change-id : I5b2fe530c90b5ce1243fc10341d6d434a1ecea7a

So in an external module I've added an entry_point in my setup.cfg :

[entry_points]
neutronclient.extension=
    my_ext = my_module

my_module is a python file containing classes which extend NeutronClientExtension and ClientExtensionList :

...

class myExt(extension.NeutronClientExtension):
    resource = 'my_ext'
    resource_plural = '%ss' % resource
    object_path = '/%s' % resource_plural
    resource_path = '/%s/%%s' % resource_plural
    versions = ['2.0']

class myExtList(extension.ClientExtensionList,
                           myExt):
    shell_command = 'my-ext-list'
    list_columns = ['id']
    pagination_support = True
    sorting_support = True

When I try to use the command :

#neutron my-ext-list

It fails with the error "unknown command"

After using a debugger, I can see that my module is correctly loaded, the command is correctly registered in the command manager of cliff, but it isn't registered in the command dict of the NeutronShell class

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

Fix proposed to branch: master
Review: https://review.openstack.org/163478

Changed in python-neutronclient:
assignee: nobody → Mathieu Rohon (mathieu-rohon)
status: New → In Progress
Kyle Mestery (mestery)
Changed in python-neutronclient:
milestone: none → 2.3.12
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (master)

Reviewed: https://review.openstack.org/163478
Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=0eb43b81e4d070af6882601bcc42c60e8fffaba3
Submitter: Jenkins
Branch: master

commit 0eb43b81e4d070af6882601bcc42c60e8fffaba3
Author: mathieu-rohon <email address hidden>
Date: Sat Mar 7 21:05:08 2015 +0100

    Add commands from extensions to available commands

    Any project can extend available commands in neutronclient
    thanks to change : I5b2fe530c90b5ce1243fc10341d6d434a1ecea7a
    However, commands submitted by external modules are not correctly
    added to available commands in the client.

    Change-Id: I53783f18e7811deee9ae7e1f48fc429afcba8936
    Closes-bug: #1430825

Changed in python-neutronclient:
status: In Progress → Fix Committed
Kyle Mestery (mestery)
Changed in python-neutronclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.