Executing of wrong command doesn't fail

Bug #1629285 reported by Vasily Gorin
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Confirmed
Medium
Fuel Sustaining

Bug Description

Steps to reproduce:
  1. got to fuel master node
  2. try to execute following commands
      # fuel2 node --version
      # fuel2 plugin list --version

Expected result:
Console shows an error message or something like that

Actual result:
Each command works like 'fuel2 --version'
# fuel2 node --version
fuel2 9.0.0
# fuel2 plugin list --version
fuel2 9.0.0

File with version of fuel is attached.

Revision history for this message
Vasily Gorin (vgorin) wrote :
Changed in fuel:
milestone: 9.1 → 9.2
Changed in fuel:
assignee: Fuel QA Team (fuel-qa) → Fuel Sustaining (fuel-sustaining-team)
Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

As far as I understand this case is reproduced only for executing fuel2 with '--version', but not with other ones. Am I right?

Revision history for this message
Stanislaw Bogatkin (sbogatkin) wrote :

Vitalii, you are right. Reproduced for any command which has double dashes. For example, 'fuel2 node --help' shows a common help. This behavior is reasonable for flags like '--debug, --verbose, --quiet' etc., but it definitely shouldn't work such way for '--help' and '--version'.

Changed in fuel:
status: New → Confirmed
Revision history for this message
Stanislaw Bogatkin (sbogatkin) wrote :

Sorry, I didn't catch your message clearly first time. No, you are not right - look at my previous message.

Changed in fuel:
assignee: Fuel Sustaining (fuel-sustaining-team) → Vitalii Kulanov (vitaliy-t)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-fuelclient (master)

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

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

@Stanislaw, I've made some patch that fixes command execution only for '--help' option.
This patch makes help message more accurate and user-friendly, e.g.:

[root@fuel ~]# fuel2 env add nodes --help
usage: fuel2 env add nodes [-h] -e ENV -n NODES [NODES ...] -r ROLES
                           [ROLES ...]

Adds nodes to an environment with the specified roles.

optional arguments:
  -h, --help show this help message and exit
  -e ENV, --env ENV Id of the environment to add nodes to
  -n NODES [NODES ...], --nodes NODES [NODES ...]
                        Ids of the nodes to add.
  -r ROLES [ROLES ...], --roles ROLES [ROLES ...]
                        Target roles of the nodes.
[root@fuel ~]# fuel2 non-existing
fuel2: 'non-existing' is not a fuel2 command. See 'fuel2 --help'.
Did you mean one of these?
  fuel-version
[root@fuel ~]# fuel2 non-existing --help
Unknown command ['non-existing']

As for the '--version' option as far as I can see the problem is in cliff itself and doesn't related to python-fuelclient directly. Because I install the latest demo from cliff and here is the result http://paste.openstack.org/show/586352/

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

Reviewed: https://review.openstack.org/388636
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=169dda2d6b5830fc4af343645e6734061dc4648b
Submitter: Jenkins
Branch: master

commit 169dda2d6b5830fc4af343645e6734061dc4648b
Author: tivaliy <email address hidden>
Date: Wed Oct 19 14:20:04 2016 +0300

    Make help message more accurate and user-friendly

    Now in python-fuelclient if we try to get help message
    for specific command with '--help' option, e.g.:

          fuel2 node list --help

    the output result looks very ugly, because it prints
    all available commands in fuel2 instead of detailed
    description for exact command. Also we have similar
    behavior if we try to specify non-existing command.
    This patch makes help message more accurate and
    user-friendly, e.g.:

          #fuel2 env add nodes --help

    usage: fuel2 env add nodes [-h] -e ENV -n NODES [NODES ...]
                               -r ROLES [ROLES ...]

    Adds nodes to an environment with the specified roles.

    optional arguments:
      -h, --help show this help message and exit
      -e ENV, --env ENV Id of the environment to add nodes to
      -n NODES [NODES ...], --nodes NODES [NODES ...]
                            Ids of the nodes to add.
      -r ROLES [ROLES ...], --roles ROLES [ROLES ...]
                            Target roles of the nodes.

         #fuel2 non-existing --help

    Unknown command ['non-existing']

    Change-Id: I89afb39d92ffb01c37fbf558e6d62091ac6112e7
    Partial-Bug: 1629285

Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

Looks like the bug is not in progress for two months.

Changed in fuel:
milestone: 9.2 → 11.0
status: In Progress → Confirmed
assignee: Vitalii Kulanov (vitaliy-t) → Fuel Sustaining (fuel-sustaining-team)
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.