Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1686299 - [insights-client] insights-client does not parse the arguments correctly.
Summary: [insights-client] insights-client does not parse the arguments correctly.
Alias: None
Product: Red Hat Insights
Classification: Red Hat
Component: Client
Version: unspecified
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: jcrafts
QA Contact: Jeff Needle
Kevin Blake
Depends On:
TreeView+ depends on / blocked
Reported: 2019-03-07 08:12 UTC by Amar Huchchanavar
Modified: 2019-04-01 19:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-04-01 19:30:00 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Amar Huchchanavar 2019-03-07 08:12:10 UTC
Description of problem:
[root@vm250-152 ca]# insights-client --help
usage: insights-client [-h] [--net-debug] [--analyze-image-id ID]
                       [--force-reregister] [--analyze-container]
                       [--conf CONF] [--disable-schedule] [--test-connection]
                       [--verbose] [--group GROUP] [--silent] [--support]
                       [--version] [--offline] [--status]
                       [--analyze-file ANALYZE_FILE]
                       [--analyze-mountpoint ANALYZE_MOUNTPOINT]
                       [--keep-archive] [--to-stdout] [--enable-schedule]
                       [--no-upload] [--display-name DISPLAY_NAME]
                       [--validate] [--logging-file LOGGING_FILE]
                       [--retry RETRIES] [--unregister] [--register] [--quiet]

If you would like to use '--test-connection' then you can just pass --test it works fine.

#insights-client --test 
#insights-client --test 
Running Connection Tests...
Connection test config:
#insights-client --keep 
# insights-client --keep 
Starting to collect Insights data for
Uploading Insights data.
Successfully uploaded report from 4462617a-9948-48cb-9435-b304221d5de5 to account 540155.
Insights archive retained in /var/tmp/Rt5glJ/
#insights-client --enable
# insights-client --enable
Automatic scheduling for Insights has been enabled.

Version-Release number of selected component (if applicable):
# insights-client --version 
Client: 3.0.3-9
Core: 3.0.68-1

Expected results:
IMO, It should only work with the exact full argument specified in the --help section.

Comment 1 jcrafts 2019-03-07 14:05:00 UTC
This a "feature" of argparse. You can disable it but only on Python 3.5 and above. Other than that we'll have to hack the crap out of .parse_args().

Comment 2 jcrafts 2019-04-01 19:30:00 UTC
There are no plans to change this behavior at this time, as it is part of the Python argparse library and would take considerable hacking to satisfy this BZ.

Note You need to log in before you can comment on or make changes to this bug.