fuel2 role create command has unclear syntax

Bug #1665567 reported by Ilya Bumarskov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Confirmed
Low
Vitalii Kulanov

Bug Description

The first problem is incorrect help message:

[root@nailgun ~]# fuel2 role create
usage: fuel2 role create [-h] -r RELEASE -n NAME -f {json,yaml} [-d DIRECTORY]
fuel2 role create: error: argument -r/--release is required

Argument "-n" is used for determining FILE, not for a NAME of new role. The name of new role is described in a file and can be different from filename.

The second problem related with mandatory argument "-f". It adds specified extension to the filename. For example, we have file "/tmp/create_role.yaml" and we want to apply it:

[root@nailgun ~]# fuel2 role create -n /tmp/create_role.yaml -r 2 -f yaml
Could not read description for role '/tmp/create_role.yaml' at /tmp/create_role.yaml.yaml

As you can see, argument "-f" adds a specified extension to the file name and it's can confuse user.

Changed in fuel:
importance: Undecided → Low
milestone: none → 10.1
description: updated
Revision history for this message
Ilya Bumarskov (ibumarskov) wrote :

It seems I used command incorrectly. Right way:

[root@nailgun ~]# fuel2 role create -n reate_role -r 2 -f yaml -d /tmp

But anyway in such case we have to upload our file with role in specific folder: release_{release_number}/{role_name}.yaml
We should describe it in help message.

Changed in fuel:
assignee: nobody → Fuel Sustaining (fuel-sustaining-team)
status: New → Confirmed
tags: added: area-python
Changed in fuel:
assignee: Fuel Sustaining (fuel-sustaining-team) → Vitalii Kulanov (vitaliy-t)
tags: added: module-client
Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

@Ilya,

What is your proposition about 'fuel2 role create' command help. Actually, in fuelclient, we have several commands with exact the same behavior as for the 'role create' command. Currently help message looks like as follows:

[root@fuel ~]# fuel2 role create --help
usage: fuel2 role create [-h] (-r RELEASE | -e ENV) -n NAME -f {json,yaml}
                         [-d DIRECTORY]

Create a role from file description

optional arguments:
  -h, --help show this help message and exit
  -r RELEASE, --release RELEASE
                        Id of the release
  -e ENV, --env ENV Id of the environment
  -n NAME, --name NAME Name of role.
  -f {json,yaml}, --format {json,yaml}
                        Format of serialized role description.
  -d DIRECTORY, --directory DIRECTORY
                        Source directory. Defaults to the current directory.

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.