openstack complete broken for tripleo, shows help text for "openstack tripleo validator run"

Bug #1949596 reported by James Slagle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Undecided
mathieu bultel

Bug Description

Try using openstack complete:

[stack@centos-8-stream ~]$ openstack complete
/usr/lib/python3.6/site-packages/secretstorage/dhcrypto.py:16: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib/python3.6/site-packages/secretstorage/util.py:25: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib64/python3.6/site-packages/_yaml/__init__.py:23: DeprecationWarning: The _yaml extension module is now located at yaml._yaml and its location is subject to change. To use the LibYAML-based parser and emitter, import from `yaml`: `from yaml import CLoader as Loader, CDumper as Dumper`.
  DeprecationWarning
/usr/lib/python3.6/site-packages/barbicanclient/__init__.py:61: UserWarning: The secrets module is moved to barbicanclient/v1 directory, direct import of barbicanclient.secrets will be deprecated. Please import barbicanclient.v1.secrets instead.
  % (name, name, name))
usage: openstack tripleo validator run [-h] [--config CONFIG]
                                       [--limit <host1>[,<host2>,<host3>,...]]
                                       [--ssh-user SSH_USER]
                                       [--validation-dir VALIDATION_DIR]
                                       [--ansible-base-dir ANSIBLE_BASE_DIR]
                                       [--validation-log-dir VALIDATION_LOG_DIR]
                                       [--inventory INVENTORY]
                                       [--output-log OUTPUT_LOG]
                                       [--junitxml JUNITXML]
                                       [--python-interpreter --python-interpreter <PYTHON_INTERPRETER_PATH>]
                                       [--extra-env-vars key1=<val1> [--extra-env-vars key2=<val2>]]
                                       [--skiplist SKIP_LIST]
                                       [--extra-vars key1=<val1> [--extra-vars key2=<val2>]
                                       | --extra-vars-file
                                       /tmp/my_vars_file.[json|yaml]]
                                       (--validation <validation_id>[,<validation_id>,...] | --group <group_id>[,<group_id>,...] | --category <category_id>[,<category_id>,...] | --product <product_id>[,<product_id>,...])
openstack tripleo validator run: error: one of the arguments --validation --group/-g --category --product is required

Instead, we get the the help text for tripleo validator run, and no bash completion function as expected.

Seems related to this commit:
https://review.opendev.org/c/openstack/validations-libs/+/792460

which from cli/base.py is calling parser.parse_known_args(), which is called from cli/run.py get_parser.

I don't think get_parser should indirectly try to parse args.

Changed in tripleo:
assignee: nobody → mathieu bultel (mat-bultel)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to validations-libs (master)
Changed in tripleo:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to validations-libs (master)

Reviewed: https://review.opendev.org/c/openstack/validations-libs/+/818177
Committed: https://opendev.org/openstack/validations-libs/commit/399d29059e102c14b2a5feb97e145c10adf899a5
Submitter: "Zuul (22348)"
Branch: master

commit 399d29059e102c14b2a5feb97e145c10adf899a5
Author: matbu <email address hidden>
Date: Wed Nov 17 00:26:47 2021 +0100

    Refactor set_argument_parser to fix shell regression

    Openstack Client and Validation Shell is hitting a regression
    due to set_argument_parser calling directly parse_known_args
    from argparse.
    This patch fix the regression and avoid the need to call
    parse_known_args directly.

    Closes-Bug: #1949596
    Change-Id: Ic9a682e7c3d5431e8779064947bd379c00aba584

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on validations-libs (master)

Change abandoned by "James Slagle <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/validations-libs/+/818144
Reason: abandoned in favor of https://review.opendev.org/c/openstack/validations-libs/+/818177

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/validations-libs 1.5.0

This issue was fixed in the openstack/validations-libs 1.5.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.