Cisco plugin cannot find argument action_prefix

Bug #1012502 reported by Harsh Prasad
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Harsh Prasad

Bug Description

While using the Cisco plugin, this is the error received when running cisco's cli command list_extensions:

harspras@harspras-ThinkPad-T400:~/openstack/quantum$ python quantum/plugins/cisco/client/cli.py list_extensions
Traceback (most recent call last):
  File "quantum/plugins/cisco/client/cli.py", line 218, in <module>
    main()
  File "quantum/plugins/cisco/client/cli.py", line 211, in main
    COMMANDS[CMD]["func"](*args)
  File "quantum/plugins/cisco/client/cli.py", line 86, in list_extensions
    action_prefix=ACTION_PREFIX_EXT, tenant="dummy")
TypeError: __init__() got an unexpected keyword argument 'action_prefix'
harspras@harspras-ThinkPad-T400:~/openstack/quantum$

I have commented the UCS and NEXUS plugins and inventory line in cisco_plugins.ini file to run without UCS and NEXUS.
Also, the HOST and PORT defined in quantum/plugins/cisco/client/cli.py is not global and is not found by 'Client' from 'quantumclient'.

Please tell me what is to be donequantum/plugins/cisco/client/cli.py

Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

This is not a plugin error, its a regression in the library for extensions. More information/fix coming to .

Changed in quantum:
assignee: nobody → Sumit Naiksatam (snaiksat)
Revision history for this message
Harsh Prasad (prasad-tanay) wrote :

Ok. So is there any way to use cisco plugin without UCS or Nexus for testing the extensions or Core API?

Changed in quantum:
status: New → In Progress
Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

Yes, you can use a REST client like the one available in Firefox:
https://addons.mozilla.org/en-US/firefox/addon/restclient/

In my earlier response I meant to say that the problem is with the "client" library being used to access the extensions. Looking at fixing it.

Revision history for this message
Harsh Prasad (prasad-tanay) wrote :

Oh.. Cool.. Will check that out. And btw i ran it successfully by making few minor changes to quantum/plugins/cisco/client/cli.py and quantumclient/__init__.py.

Changes made are as following:

to quantum/plugins/cisco/client/cli.py in def main(): + global HOST
                                                                                                + global PORT
                                                                                                + global USE_SSL

to quantumclient/__init__.py in def __init__() of class Client:

+ action_prefix="/v1.1/tenants/{tenant_id}", ## In the arguments of __init__()
+ self.action_prefix = action_prefix#"/v%s%s" % (version, uri_prefix)

After these changes, the cisco client was working. Do tell if such changes should not be made.

Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

Harsh, thats great to hear that you were able to make it work with those changes, well done!

The variable definition changes are good. The changes to the quantumclient are also good for this particular case, however, we ideally want to make changes only to cli.py for getting this to work. One way to do it would be to change action_prefix in the cli.py to uri_prefix. I was running into some other problems after doing that, hence did not commit it right away.

Revision history for this message
Harsh Prasad (prasad-tanay) wrote :

Ok. I will then make changes to only quantum/plugins/cisco/client/cli.py. What I'll do is that i will add version and uri_prefix instead of action_prefix and the default __init__.py will gather the information correspondingly. Will let you know how it works. And if it looks fine then i will commit the changes.

Changed in quantum:
assignee: Sumit Naiksatam (snaiksat) → Harsh Prasad (prasad-tanay)
Changed in quantum:
assignee: Harsh Prasad (prasad-tanay) → nobody
assignee: nobody → Harsh Prasad (prasad-tanay)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

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

Revision history for this message
Harsh Prasad (prasad-tanay) wrote :

Hey, was trying to commit a draft but i was getting an error of cannot create new references. So i tried changing the assignee, but no luck. So i had to submit a final review and not a draft.

Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

Assigned this to you, so you should be good now. Thanks!

Changed in quantum:
assignee: Harsh Prasad (prasad-tanay) → nobody
assignee: nobody → Harsh Prasad (prasad-tanay)
milestone: none → folsom-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/8522
Committed: http://github.com/openstack/quantum/commit/7b9a0b714736711acdb128b00e8e2f8aea7c41e4
Submitter: Jenkins
Branch: master

commit 7b9a0b714736711acdb128b00e8e2f8aea7c41e4
Author: Harsh Prasad <email address hidden>
Date: Thu Jun 14 16:47:56 2012 +0530

    Cisco cli cannot find argument action_prefix

    Bug #1012502

    Removed use of argument action_prefix for Client. Also, made HOST, PORT and USE_SSL global.
    Signed-off-by: Harsh Prasad <email address hidden>

    Change-Id: I93037b34fca89786778a2dcd8a3afc80df5687f8

Changed in quantum:
status: In Progress → Fix Committed
Changed in quantum:
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: folsom-2 → 2012.2
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.