Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-24305

Hammer host update false positive when excluding lifecycle environment

XMLWordPrintable

    • Sprint 134, Sprint 135, Sprint 136, Sprint 137
    • Moderate
    • No

      Description of problem:
      When updating a host's content view assignment without including a lifecycle environment value produces a false positive leading a user to believe the update was successful.

      Version-Release number of selected component (if applicable):
      rubygem-hammer_cli_foreman-3.7.0-1.el8sat.noarch
      rubygem-hammer_cli_foreman_discovery-1.1.0-1.el8sat.noarch
      rubygem-hammer_cli_foreman_tasks-0.0.19-1.el8sat.noarch
      rubygem-hammer_cli_foreman_google-1.0.1-1.el8sat.noarch
      rubygem-hammer_cli_foreman_admin-1.1.0-1.el8sat.noarch
      rubygem-hammer_cli_katello-1.9.1.3-1.el8sat.noarch
      rubygem-hammer_cli_foreman_remote_execution-0.2.3-1.el8sat.noarch
      rubygem-hammer_cli_foreman_azure_rm-0.2.2-1.el8sat.noarch
      rubygem-hammer_cli_foreman_openscap-0.1.13-2.el8sat.noarch
      rubygem-hammer_cli-3.7.0.1-1.el8sat.noarch
      rubygem-hammer_cli_foreman_ansible-0.5.0-1.el8sat.noarch
      rubygem-hammer_cli_foreman_bootdisk-0.3.0-3.el8sat.noarch
      rubygem-hammer_cli_foreman_templates-0.2.0-3.el8sat.noarch
      rubygem-hammer_cli_foreman_webhooks-0.0.4-1.el8sat.noarch
      rubygem-hammer_cli_foreman_virt_who_configure-0.0.9-2.el8sat.noarch

      How reproducible:
      Every time

      Steps to Reproduce:
      1. Using a satellite with a registered client and content view created
      2. Use the command 'hammer host update --id <HOST ID> --content-view "<CONTENT VIEW>"' to update the content view of the host.
      3. Check the content view assignment of the host

      Actual results:
      Host content view assignment remains unchanged and hammer command produces "Host updated"
      [root@bombsat614 ~]# hammer host info --id 4
      Id: 4
      Name: drone79.usersys.redhat.com
      Organization: Default Organization
      -snip-
      Content Information:
      Content view environments:
      1) Content view:
      Id: 1
      Name: Default Organization View
      Composite: no
      Lifecycle environment:
      Id: 1
      Name: Library
      -snip-

      [root@bombsat614 ~]# hammer host update --id 4 --content-view test-small --organization-id 1
      Host updated.

      [root@bombsat614 ~]# hammer host info --id 4
      Id: 4
      Name: drone79.usersys.redhat.com
      Organization: Default Organization
      -snip-
      Content Information:
      Content view environments:
      1) Content view:
      Id: 1
      Name: Default Organization View
      Composite: no
      Lifecycle environment:
      Id: 1
      Name: Library
      -snip-

      Expected results:
      Hammer command should fail with an error message notifying the user that the "--lifecycle-environment[-id]" is required to change the content view of the client.

      Additional info:
      seen from the production.log
      2024-04-01T13:48:15 [I|app|006365b9] Started PUT "/api/hosts/4" for 10.13.226.224 at 2024-04-01 13:48:15 -0400
      2024-04-01T13:48:15 [I|app|006365b9] Processing by Api::V2::HostsController#update as JSON
      2024-04-01T13:48:15 [I|app|006365b9] Parameters: {"organization_id"=>1, "host"=>{"content_facet_attributes"=>

      {"content_view_id"=>2}

      , "subscription_facet_attributes"=>{}}, "apiv"=>"v2", "id"=>"4"}
      2024-04-01T13:48:15 [I|app|006365b9] Authorized user admin(Admin User)

      [HERE]
      2024-04-01T13:48:15 [I|app|006365b9] set_up_content_view_environment: cv_id=2, env_id=

      2024-04-01T13:48:15 [I|app|006365b9] ForemanWebhooks::EventSubscriber: host_updated.event.foreman event received
      2024-04-01T13:48:15 [I|app|006365b9] Rendered api/v2/hosts/update.json.rabl (Duration: 206.3ms | Allocations: 58080)
      2024-04-01T13:48:15 [I|app|006365b9] Completed 200 OK in 462ms (Views: 187.3ms | ActiveRecord: 73.5ms | Allocations: 81245)

            rhn-engineering-paji Partha Aji
            rhn-support-tasander Taft Sanders
            Partha Aji
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: