It is unclear what options are actually mandatory for some commands

Bug #1933390 reported by Cyril Roelandt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Low
Cyril Roelandt

Bug Description

Some commands (location-add, location-delete,location-update,md-object-create,md-property-create,md-tag-create,md-tag-create-multiple,md-tag-update,member-list,stores-delete) have mandatory options:

---
$ glance help location-add
usage: glance location-add --url <URL> [--metadata <STRING>]
                           [--checksum <STRING>] [--hash-algo <STRING>]
                           [--hash-value <STRING>]
                           <IMAGE_ID>

Add a location (and related metadata) to an image.

Positional arguments:
  <IMAGE_ID> ID of image to which the location is to be added.

Optional arguments:
  --url <URL> URL of location to add.
  --metadata <STRING> Metadata associated with the location. Must be a valid
                        JSON object (default: {})
  --checksum <STRING> md5 checksum of image contents
  --hash-algo <STRING> Multihash algorithm
  --hash-value <STRING>
                        Multihash value
---

Looking at the first line of the output, one can understand that "--url <URL>" is mandatory, but the info is easy to overlook. Furthermore, "--url" appears in the list of "optional" arguments.

It would be great to make it perfectly clear that some options are less optional than others.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)
Changed in python-glanceclient:
status: New → In Progress
Changed in python-glanceclient:
assignee: nobody → Cyril Roelandt (cyril-roelandt)
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-glanceclient/+/797779
Committed: https://opendev.org/openstack/python-glanceclient/commit/91ae9347dbc125a19fedd107df5cc013e018e7e1
Submitter: "Zuul (22348)"
Branch: master

commit 91ae9347dbc125a19fedd107df5cc013e018e7e1
Author: Cyril Roelandt <email address hidden>
Date: Wed Jun 23 23:18:49 2021 +0200

    glance help <subcommand>: Clearly specify which options are mandatory

    Earlier glance help <subcommand> was listing required arguments as
    optional arguments in help text. Added new argument group to list
    required argument properly.

    $ glance help stores-delete

    Example before this change:
    usage: glance stores-delete --store <STORE_ID> <IMAGE_ID>

    Delete image from specific store.

    Positional arguments:
      <IMAGE_ID> ID of image to update.

    Optional arguments:
      --store <STORE_ID> Store to delete image from.

    After this change:
    usage: glance stores-delete --store <STORE_ID> <IMAGE_ID>

    Delete image from specific store.

    Positional arguments:
      <IMAGE_ID> ID of image to update.

    Required arguments:
      --store <STORE_ID> Store to delete image from.

    Change-Id: I51ea4c43fa62164ed43e78d1ae0fb0cb2521fc83
    Closes-Bug: #1933390

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

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