Help text for deprecated cli option has _ rather than -

Bug #1279973 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Invalid
Low
Unassigned
oslo.config
Fix Released
Low
Ben Nemec

Bug Description

In oslo-incubator log.py, there's a cli option with a deprecated value [1].

    cfg.StrOpt('log-config-append',
               deprecated_name='log-config',
               help='...'),

When the help text is generated, the primary name has the -s as expected, but the deprecated name has _:

  --log-config-append PATH, --log_config PATH

You can see this in the output of keystone-all --help.

The deprecated name in the help text should use - just like the primary name, so the output should be like:

  --log-config-append PATH, --log-config PATH

[1] http://git.openstack.org/cgit/openstack/oslo-incubator/tree/openstack/common/log.py?id=4f7e269ddb8f388c715c2505151a4f8add71dd0f#n83

Tags: config
Revision history for this message
Luis de Bethencourt (l2is) wrote :

I can look into this. Thanks :)

Changed in oslo:
assignee: nobody → Luis de Bethencourt (l2is)
Revision history for this message
Brant Knudson (blk-u) wrote :

I added keystone since it shows up in the help text but since this is in oslo.config (I assume) all we have to do is wait for the new release.

Revision history for this message
Luis de Bethencourt (l2is) wrote :

Found the problem. Now figuring out the best way to fix it.

Revision history for this message
Luis de Bethencourt (l2is) wrote :
Revision history for this message
Dolph Mathews (dolph) wrote :

This is probably a result of the switch from --all_options_using_undscores to --all-options-using-hyphens-instead

Changed in keystone:
importance: Undecided → Low
Changed in keystone:
assignee: nobody → Victor Howard (victor-r-howard)
Revision history for this message
Luis de Bethencourt (l2is) wrote :

Hello Victor,

I am new to the OpenStack community. Do you mind if I ask you what it means that you assign the keystone part of this bug to yourself?

From reading the code I can see the source of the problem is in oslo.config, and fixed in my patch. There is probably nothing to do in keystone since this will automatically be sorted out when the code from oslo.config is imported in.

Revision history for this message
Victor Howard (victor-r-howard) wrote : Re: [Bug 1279973] Re: Help text for deprecated cli option has _ rather than -

Just means that im marking it as something id like to help the community with. Are you recommending that we close this issue?

Vic

> On Feb 16, 2014, at 1:47 PM, Luis de Bethencourt <email address hidden> wrote:
>
> Hello Victor,
>
> I am new to the OpenStack community. Do you mind if I ask you what it
> means that you assign the keystone part of this bug to yourself?
>
>> From reading the code I can see the source of the problem is in
> oslo.config, and fixed in my patch. There is probably nothing to do in
> keystone since this will automatically be sorted out when the code from
> oslo.config is imported in.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1279973
>
> Title:
> Help text for deprecated cli option has _ rather than -
>
> Status in OpenStack Identity (Keystone):
> New
> Status in Oslo - a Library of Common OpenStack Code:
> New
>
> Bug description:
>
> In oslo-incubator log.py, there's a cli option with a deprecated value [1].
>
> cfg.StrOpt('log-config-append',
> deprecated_name='log-config',
> help='...'),
>
> When the help text is generated, the primary name has the -s as
> expected, but the deprecated name has _:
>
> --log-config-append PATH, --log_config PATH
>
> You can see this in the output of keystone-all --help.
>
> The deprecated name in the help text should use - just like the
> primary name, so the output should be like:
>
> --log-config-append PATH, --log-config PATH
>
> [1] http://git.openstack.org/cgit/openstack/oslo-
> incubator/tree/openstack/common/log.py?id=4f7e269ddb8f388c715c2505151a4f8add71dd0f#n83
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/keystone/+bug/1279973/+subscriptions

Revision history for this message
Luis de Bethencourt (l2is) wrote :

No, this shouldn't be closed until the patch (73694) is reviewed and merged. Just saying that the problem will be fixed in Keystone as well when that happens.

Revision history for this message
Victor Howard (victor-r-howard) wrote :

Ah had no clue that u fixed it already thanks for the heads up

Vic

> On Feb 16, 2014, at 3:04 PM, Luis de Bethencourt <email address hidden> wrote:
>
> No, this shouldn't be closed until the patch (73694) is reviewed and
> merged. Just saying that the problem will be fixed in Keystone as well
> when that happens.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1279973
>
> Title:
> Help text for deprecated cli option has _ rather than -
>
> Status in OpenStack Identity (Keystone):
> New
> Status in Oslo - a Library of Common OpenStack Code:
> New
>
> Bug description:
>
> In oslo-incubator log.py, there's a cli option with a deprecated value [1].
>
> cfg.StrOpt('log-config-append',
> deprecated_name='log-config',
> help='...'),
>
> When the help text is generated, the primary name has the -s as
> expected, but the deprecated name has _:
>
> --log-config-append PATH, --log_config PATH
>
> You can see this in the output of keystone-all --help.
>
> The deprecated name in the help text should use - just like the
> primary name, so the output should be like:
>
> --log-config-append PATH, --log-config PATH
>
> [1] http://git.openstack.org/cgit/openstack/oslo-
> incubator/tree/openstack/common/log.py?id=4f7e269ddb8f388c715c2505151a4f8add71dd0f#n83
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/keystone/+bug/1279973/+subscriptions

Revision history for this message
Luis de Bethencourt (l2is) wrote :

Sorry I hadn't linked the fix to this bug properly with "Closes Bug ###". I edited the commit message and it should be linked now.

My pleasure :)

Changed in keystone:
assignee: Victor Howard (victor-r-howard) → nobody
Ben Nemec (bnemec)
Changed in oslo:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Luis de Bethencourt (l2is) wrote :

Thanks for triaging Ben. There is a commit ready for review/merge in gerrit.

https://review.openstack.org/#/c/73694/

tags: added: config
Revision history for this message
Mark McLoughlin (markmc) wrote :

Not a bug in keystone; once it's fixed in oslo.config, we're done ... so no need to track it in keystone

Changed in keystone:
status: New → Invalid
affects: oslo-incubator → oslo.config
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.config (master)

Change abandoned by Doug Hellmann (<email address hidden>) on branch: master
Review: https://review.openstack.org/73694
Reason: This patch has been open without update for several months.

Changed in oslo.config:
assignee: Luis de Bethencourt (l2is) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (master)

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

Changed in oslo.config:
assignee: nobody → Ben Nemec (bnemec)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (master)

Reviewed: https://review.openstack.org/438752
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=0c6040ef6b85a77abd277a9e63be614877ca7c6a
Submitter: Jenkins
Branch: master

commit 0c6040ef6b85a77abd277a9e63be614877ca7c6a
Author: Ben Nemec <email address hidden>
Date: Tue Feb 28 00:02:16 2017 +0000

    Handle both - and _ forms of deprecated opts

    While config file opts cannot have a - in their name, CLI opts can
    and the current deprecation code doesn't handle that case properly.
    Additionally, because oslo.config has some magic to translate one
    to the other it is possible we have existing users relying on the
    wrong behavior. For this reason, let's add both forms of the opt
    when adding deprecated opts. This will allow both to work as
    expected.

    The config generator is updated to ignore the - form of deprecated
    opts since they won't work in a config file anyway.

    I'm unsure how to filter the extra opts out of the help text, but
    since both forms will work in that case it's a minor cosmetic
    issue.

    Change-Id: I4d2584b33d97fe00a427b992682d9eac391725a2
    Closes-Bug: 1279973

Changed in oslo.config:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.config 3.24.0

This issue was fixed in the openstack/oslo.config 3.24.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.