Bug 1723751 - [RFE] Provide a script-like interface to task cleanup, preventing wrong values from being entered
Summary: [RFE] Provide a script-like interface to task cleanup, preventing wrong value...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.11.0
Assignee: Adam Ruzicka
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-25 09:47 UTC by Steffen Froemer
Modified: 2022-07-05 14:28 UTC (History)
13 users (show)

Fixed In Version: tfm-rubygem-foreman-tasks-5.2.1-2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:27:54 UTC
Target Upstream Version:
Embargoed:
aupadhye: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27790 0 Normal Closed [RFE] Provide a script-like interface to task cleanup, preventing wrong values from being entered 2022-03-02 08:37:59 UTC
Github theforeman foreman-packaging pull 7638 0 None open Place convenience scripts into root bindir 2022-02-28 12:25:28 UTC
Red Hat Knowledge Base (Solution) 4328391 0 None None None 2019-08-19 13:47:51 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:28:06 UTC

Internal Links: 1622264

Description Steffen Froemer 2019-06-25 09:47:57 UTC
1. Proposed title of this feature request
[RFE] Show Invalid Options Error if unsupported Options are used in TASK-Filter

3. What is the nature and description of the request?
Show a INVALID OPTION error message when a Option is used, which is not supported

4. Why does the customer need this? (List the business requirements here)
To avoid irritation and misinterpretation, a clean ERROR message with unsupported Option make it very clear.


5. How would the customer like to achieve this? (List the functional requirements here)
Show a INVALID Option error


6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
$ foreman-rake foreman_tasks:export_tasks WHAT-EVEROPTION=NULL
ERROR: UNSUPPORTED OPTION, please check `foreman-rake -D foreman_tasks:export_tasks` for valid options.


7. Is there already an existing RFE upstream or in Red Hat Bugzilla?
no


8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?
asap


9. Is the sales team involved in this request and do they have any additional input?
no


10. List any affected packages or components.
tfm-rubygem-foreman-tasks



11. Would the customer be able to assist in testing this functionality if implemented?
sure

Comment 4 Steffen Froemer 2019-06-25 09:51:50 UTC
Additional info:

Currently, when a unknown option is used, the command will ignore it and use default values. This could have impact if one made a typo
Example:

$ foreman-rake foreman_tasks:export_tasks  TAKS_SEARCH='' 
Gathering 1500 tasks.
1/1500
[...]

Note: TAKS_SEARCH vs. TASKS_SEARCH

Comment 11 Adam Ruzicka 2019-06-26 07:43:05 UTC
Changing the title to better match what was discussed in the comments

Comment 22 Peter Ondrejka 2022-04-06 13:42:59 UTC
Checked on Satellite 6.11 snap 15, the previous issues have been fixed, scripts are available in path, I successfully executed both foreman-tasks-cleanup and foreman-tasks-export with various combinations of options.

However, I found a different issue with foreman-tasks-cleanup by chance. If it is executed from a directory that contains some files, it seems to take the first file in the dir a and use it as a parameter:

~]# foreman-tasks-cleanup -s * -a 10d -v --noop -S failed
foreman-rake foreman_tasks:cleanup AFTER=10d NOOP=1 TASK_SEARCH=ssl-build STATES=failed VERBOSE=1 
~]# touch test.csv
~]# foreman-tasks-cleanup -s * -a 10d -v --noop -S failed
Unaccepted parameter: test.csv

Comment 23 Adam Ruzicka 2022-04-06 13:54:14 UTC
But that's not caused by the script. That's your shell expanding * to a list of files in your current directory. If you properly quote/escape it, it should work as expected.

Comment 24 Peter Ondrejka 2022-04-07 07:50:26 UTC
Ah true, it was due to the unescaped queries. Moving to verified on 6.11 snap 15

Comment 27 errata-xmlrpc 2022-07-05 14:27:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498


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