parse service version from console input bug

Bug #1658614 reported by QianBiao Ng on 2017-01-23
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_', '')
```

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
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) on 2017-02-06
Changed in python-openstackclient:
assignee: nobody → Rui Chen (kiwik-chenrui)

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

Changed in python-openstackclient:
status: Confirmed → In Progress
Rui Chen (kiwik-chenrui) wrote :

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

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.

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

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  Edit
Everyone can see this information.

Other bug subscribers