Project

General

Profile

Bug #34079

Hammer unable to send correct value for for Job Templates in order to update ALL packages.

Added by Oleh Fedorenko 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
Other commands
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2022649

Description of problem:
Using the Job Template i.e "Package Action - Ansible Default" trying to execute a remote execution job to install ALL packages present on the client system. However. it is failing due to the * option used in the hammer command.

If the same Job Template is used through the Satellite Web UI the job works perfectly fine.

It seems when satellite Web UI takes input for the "name" parameter which is . the value is properly taken.
But when hammer takes in even with the "
" option it does not go in as * and hence fails.

Even after changing multiple options for the argument "--name=??" hammer does not send the same value to the satellite.
But in the debug option it looks like it sends but it does not.

-----
[ INFO 2021-11-12T13:46:36 HammerCLIForemanRemoteExecution::JobInvocation::CreateCommand] Called with options: {"option_inputs"=>{"state"=>"latest", "name"=>"\\'*\\",---------------------->>>>>> (VALUE ENTERED HERE...)
"post_script"=>"needs-restarting r || shutdown -r +1"}, "option_job_template_name"=>"Package Action - Ansible Default", "option_job_template_id"=>179, "option_search_query"=>"HOSTNAME"}
[ INFO 2021-11-12T13:46:36 API] Server: https://satellite.example.redhat.com
[ INFO 2021-11-12T13:46:36 API] POST /api/job_invocations
[DEBUG 2021-11-12T13:46:36 API] Params: {
"job_invocation" => {
"job_template_id" => 179,
"inputs" => {
"state" => "latest",
"name" => "*", -------------------------->>>>> This is correct Value but this is not correct.
"post_script" => "needs-restarting -r || shutdown -r +1"
},
-----

Version-Release number of selected component (if applicable):
satellite 6.9

How reproducible:
100%

Steps to Reproduce:
1. Run the following command on the satellite cli:
----- # hammer d job-invocation create --job-template "Package Action - Ansible Default" --inputs state="latest",name="*",post_script="needs-restarting -r || shutdown -r +1" --search-query "client_hostname"
-----

Actual results:
Using the hammer comment the Job fails every time. There is no way to pass any option to specific "ALL" as an option to update ALL packages.

Expected results:
Using the hammer command as well this should job should execute properly.

Additional info:

Associated revisions

Revision 9375f2d8 (diff)
Added by Oleh Fedorenko 5 months ago

Fixes #34079 - Allow explicit strings in key=value options (#356)

History

#1 Updated by Oleh Fedorenko 6 months ago

  • Assignee set to Oleh Fedorenko
  • Status changed from New to Assigned

#2 Updated by The Foreman Bot 6 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/356 added

#3 Updated by The Foreman Bot 5 months ago

  • Fixed in Releases hammer-cli-3.2.0 added

#4 Updated by Oleh Fedorenko 5 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF