Breakage of OSC plugin prevent OSC to work

Bug #1722008 reported by hongbin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Unassigned

Bug Description

Description
===========
If there is an exception on importing OSC plugin module (for various reason such as the plugin is broken), OSC will stop execution of the command.

Reproduce
=========
* Install OSC
* Install a broken plugin
* Execute any command. For example:

$ openstack network list
Traceback (most recent call last):
  File "/usr/bin/openstack", line 6, in <module>
    from openstackclient.shell import main
  File "/home/hongbin/python-openstackclient/openstackclient/shell.py", line 28, in <module>
    from openstackclient.common import clientmanager
  File "/home/hongbin/python-openstackclient/openstackclient/common/clientmanager.py", line 170, in <module>
    'openstack.cli.extension',
  File "/home/hongbin/python-openstackclient/openstackclient/common/clientmanager.py", line 137, in get_plugin_modules
    __import__(ep.module_name)
  File "/opt/stack/python-zunclient/zunclient/osc/plugin.py", line 30, in <module>
    API_VERSIONS['1'] = API_VERSIONS[DEFAULT_CONTAINER_API_VERSION]
KeyError: '1.11'

Expected result
===============
The command should continue to execute. OSC prints warning on the failure of importing plugin.

Actual result
=============
The command stopped executing.

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

Reviewed: https://review.openstack.org/510308
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=599fa782623598208c012125dd988a48774cfc6e
Submitter: Zuul
Branch: master

commit 599fa782623598208c012125dd988a48774cfc6e
Author: Hongbin Lu <email address hidden>
Date: Sat Oct 7 14:03:14 2017 -0400

    Be robust on import plugin module

    On loading external plugin, OSC should be robust on importing the
    plugin module so that commands from other modules can continue to
    execute.

    Closes-Bug: #1722008
    Change-Id: Ibe716681c7f78fabee31b7ef281af2588d68ab30

Changed in python-openstackclient:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-openstackclient 3.13.0

This issue was fixed in the openstack/python-openstackclient 3.13.0 release.

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.