Description of problem: On Satellite 6.4, attempting to change a hosts service level via the hammer cli fails stating that a numeric value is required instead of accepting a string: [root@galileo ~]# hammer host update --service-level=PREMIUM --id 43 Could not update the host: Error: Option '--service-level': Numeric value is required.. See: 'hammer host update --help'. Version-Release number of selected component (if applicable): Satellite 6.4 How reproducible: 100% Steps to Reproduce: 1. Login to a Satellite 6.4 system via the command line 2. Attempt to update a hosts service level via `hammer host update --service-level=PREMIUM --id [MYHOSTID]` 3. Actual results: [root@galileo ~]# hammer host update --service-level=PREMIUM --id 43 Could not update the host: Error: Option '--service-level': Numeric value is required.. See: 'hammer host update --help'. Expected results: It should update the host service level as it previously did in satellite 6.3 Additional info: Error from commit: https://github.com/Katello/katello/commit/29f42a35bb9eddcfc8271bc1e3d1dd569579134d#diff-beaa1cde8d4964406e1f688ae9de5befR10 error in app/controllers/katello/api/v2/host_subscriptions_controller.rb line #10 wrong: param :service_level, Integer, :desc => N_("Service level to be used for autoheal.") correct: param :service_level, String, :desc => N_("Service level to be used for autoheal.") Error: [DEBUG 2019-01-31T16:42:01 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_usage_exception [ERROR 2019-01-31T16:42:01 Exception] Error: Option '--service-level': Numeric value is required.. See: 'hammer host update --help'. Could not update the host: Error: Option '--service-level': Numeric value is required.. See: 'hammer host update --help'. [ERROR 2019-01-31T16:42:01 Exception] Clamp::UsageError (Option '--service-level': Numeric value is required..): /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/option/parsing.rb:41:in `rescue in set_options_from_command_line' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/option/parsing.rb:38:in `set_options_from_command_line' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/option/parsing.rb:9:in `parse_options' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:48:in `parse' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:40:in `parse' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:62:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/bin/hammer:143:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>' Workaround: change /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.42/app/controllers/katello/api/v2/host_subscriptions_controller.rb from: param :service_level, Integer, :desc => N_("Service level to be used for autoheal.") to: param :service_level, String, :desc => N_("Service level to be used for autoheal.") FOREMAN_APIPIE_LANGS=en foreman-rake apipie:cache hammer -dr
Created redmine issue https://projects.theforeman.org/issues/26046 from this bug
Upstream bug assigned to cfouant
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26046 has been resolved.
This remains a candidate for a future sat-6.4.z and will be cloned by the zstream triage team once selected. Thanks!
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, 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-2019:1222