parse service version from console input bug

Bug #1658614 reported by QianBiao Ng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Medium
Rui Chen

Bug Description

When openstackclient parse service version, it will replace all 'os' with '', then if service name ends with os, it could not get right version. for example, when service name is antiddos, then version option is --os-antiddos-api-version, then final parsed will be antidd-api-version but not antiddos-api-version.

bug code position is shell.py#_load_plugins

```
    def _load_plugins(self):
        """Load plugins via stevedore

        osc-lib has no opinion on what plugins should be loaded
        """
        # Loop through extensions to get API versions
        for mod in clientmanager.PLUGIN_MODULES:
            default_version = getattr(mod, 'DEFAULT_API_VERSION', None)
            option = mod.API_VERSION_OPTION.replace('os_', '')
```

Revision history for this message
Steve Martinelli (stevemar) wrote :

does this happen with a plugin now? do we need to raise the bug priority?

Changed in python-openstackclient:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
QianBiao Ng (woo.cubic) wrote :

Currently, I am working on a openstackclient plugin named antiddos.
And I need to release the plugin to our prod env in two weeks.

Rui Chen (kiwik-chenrui)
Changed in python-openstackclient:
assignee: nobody → Rui Chen (kiwik-chenrui)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

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

Changed in python-openstackclient:
status: Confirmed → In Progress
Revision history for this message
Rui Chen (kiwik-chenrui) wrote :

Hi QianBiao Ng, please try the aboving patch, that should fix the issue you faced.

Revision history for this message
QianBiao Ng (woo.cubic) wrote :

Hi RuiChen, thx for you work. I have fixed this in my local env, but our customers install python-openstackclient with
`pip install python-openstackclient`, this is the problem :). Hope the patch will appear in pip repo soon.

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

Reviewed: https://review.openstack.org/429645
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=e8b6a9f7be7e773396c8fe1021d8798aa0e2a4a9
Submitter: Jenkins
Branch: master

commit e8b6a9f7be7e773396c8fe1021d8798aa0e2a4a9
Author: Rui Chen <email address hidden>
Date: Mon Feb 6 18:49:40 2017 +0800

    Fix wrong behavior of parsing plugin service name

    When the service name end with keyword "os", like: antiddos,
    the parsing logic isn't suitable, that cause the service api
    version specified by users don't work.

    Change-Id: I5d6217c77d7cd2d2f360d78d8561261398b96685
    Closes-Bug: #1658614

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

This issue was fixed in the openstack/python-openstackclient 3.9.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.