openstackclient commands doesn't work

Bug #1801689 reported by Tushar Patil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-masakariclient
Fix Released
Critical
Tushar Patil

Bug Description

If you have installed openstackclient and masakariclient on your machine, then none of the openstack commands work as it fails to load the masakari plugin.

$openstack segment list
Traceback (most recent call last):
  File "/usr/local/bin/openstack", line 7, in <module>
    from openstackclient.shell import main
  File "/usr/local/lib/python2.7/dist-packages/openstackclient/shell.py", line 28, in <module>
    from openstackclient.common import clientmanager
  File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/clientmanager.py", line 195, in <module>
    'openstack.cli.extension',
  File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/clientmanager.py", line 172, in get_plugin_modules
    module.API_NAME,
AttributeError: 'module' object has no attribute 'API_NAME'

Reason: openstack client expects API_NAME global constant in masakariclient/plugins.py.

Below code fixes this issue:

diff --git a/masakariclient/plugin.py b/masakariclient/plugin.py
index 794ab47..8d22d84 100644
--- a/masakariclient/plugin.py
+++ b/masakariclient/plugin.py
@@ -18,7 +18,7 @@ from osc_lib import utils

 DEFAULT_HA_API_VERSION = '1'
 API_VERSION_OPTION = 'os_ha_api_version'
-
+API_NAME = 'ha'

 def make_client(instance):
     """Returns a instance_ha proxy"""

Tushar Patil (tpatil)
Changed in python-masakariclient:
importance: Undecided → Critical
Changed in python-masakariclient:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-masakariclient (master)

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

Changed in python-masakariclient:
assignee: nobody → Tushar Patil (tpatil)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-masakariclient (master)

Reviewed: https://review.openstack.org/615752
Committed: https://git.openstack.org/cgit/openstack/python-masakariclient/commit/?id=71ce1fbb4a46c2da102581c9e1d0384598199ba6
Submitter: Zuul
Branch: master

commit 71ce1fbb4a46c2da102581c9e1d0384598199ba6
Author: tpatil <email address hidden>
Date: Tue Nov 6 16:14:51 2018 +0900

    Fix osc command issue

    If you have installed openstackclient and masakariclient on your
    machine, then none of the openstack commands work as it fails to
    load the masakari plugin.

    Added 'API_NAME' global constants which osc clientmanager expects
    during initialization of masakari plugin.

    Change-Id: Id33bd45ee1625a23ae43090a45d8b0f9ff2bf56a
    Closes-Bug: #1801689

Changed in python-masakariclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-masakariclient (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/621490

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-masakariclient (stable/rocky)

Reviewed: https://review.openstack.org/621490
Committed: https://git.openstack.org/cgit/openstack/python-masakariclient/commit/?id=5336f802f69a18b56eab9303230f3da56a38d95a
Submitter: Zuul
Branch: stable/rocky

commit 5336f802f69a18b56eab9303230f3da56a38d95a
Author: tpatil <email address hidden>
Date: Tue Nov 6 16:14:51 2018 +0900

    Fix osc command issue

    If you have installed openstackclient and masakariclient on your
    machine, then none of the openstack commands work as it fails to
    load the masakari plugin.

    Added 'API_NAME' global constants which osc clientmanager expects
    during initialization of masakari plugin.

    Change-Id: Id33bd45ee1625a23ae43090a45d8b0f9ff2bf56a
    Closes-Bug: #1801689
    (cherry picked from commit 71ce1fbb4a46c2da102581c9e1d0384598199ba6)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-masakariclient 5.3.0

This issue was fixed in the openstack/python-masakariclient 5.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-masakariclient rocky-eol

This issue was fixed in the openstack/python-masakariclient rocky-eol 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.