Bug 1372372 - hammer host collection package/erratum subcommands are broken
Summary: hammer host collection package/erratum subcommands are broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Host Collections
Version: 6.2.0
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: Andrii Balakhtar
URL:
Whiteboard:
: 1376355 1383985 1392760 1395698 1405434 (view as bug list)
Depends On:
Blocks: 1377245 1417115
TreeView+ depends on / blocked
 
Reported: 2016-09-01 14:09 UTC by Andrii Balakhtar
Modified: 2020-12-14 07:43 UTC (History)
13 users (show)

Fixed In Version: rubygem-katello-3.0.0.98-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1417115 (view as bug list)
Environment:
Last Closed: 2017-03-06 08:44:46 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15978 0 Normal Closed hammer host-collection package/package-group/erratum commands use the old systems_controller 2020-03-28 17:00:59 UTC
Red Hat Knowledge Base (Solution) 2899001 0 None None None 2017-02-02 06:04:53 UTC
Red Hat Product Errata RHBA-2017:0446 0 normal SHIPPED_LIVE Satellite 6.2.8 Tools Async Release 2017-03-06 13:43:51 UTC

Description Andrii Balakhtar 2016-09-01 14:09:51 UTC
Description of problem:
These 3 subcommands are broken:
hammer host-collection package install/update/remove
hammer host-collection package-group install/update/remove
hammer host-collection erratum install

As per Redmine bug #15978, it may be due to old controller, which wasn't updated while host unification.


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

How reproducible:
Always

Steps to Reproduce:
1. Execute 
`host-collection erratum install --errata="RHEA-2012:0055" --organization-id="13" --id="2"`, 
`host-collection erratum install --packages="walrus" --organization-id="13" --id="2"` 
or something similar
2.
3.

Actual results:
Following error message:
Could not schedule installation of package(s):
  Error: The server does not support such operation.

Hammer log in debug mode contains following lines:
[ INFO 2016-09-01 09:50:38 HammerCLIKatello::HostCollection] Called with options: {}
[ INFO 2016-09-01 09:50:38 HammerCLIKatello::HostCollectionPackageCommand] Called with options: {}
[ INFO 2016-09-01 09:50:38 HammerCLIKatello::HostCollectionPackageCommand::InstallCommand] Called with options: {"content"=>["walrus"], "option_organization_id"=>"13", "option_id"=>"2"}
[ERROR 2016-09-01 09:50:38 Exception] Error: The server does not support such operation.
[ERROR 2016-09-01 09:50:38 Exception] 

HammerCLI::OperationNotSupportedError (The server does not support such operation.):
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/apipie/command.rb:45:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.9/lib/hammer_cli_foreman/commands.rb:190:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/shell.rb:100:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.11/bin/hammer:125:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'


Expected results:
Errata/Package was successfully scheduled for installation

Additional info:

Comment 2 Bryan Kearney 2016-09-01 16:20:01 UTC
Upstream bug component is Host Collections

Comment 4 Bryan Kearney 2016-09-20 22:19:19 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/15978 has been resolved.

Comment 5 Brad Buckingham 2016-09-22 19:20:33 UTC
*** Bug 1376355 has been marked as a duplicate of this bug. ***

Comment 8 Brad Buckingham 2016-10-14 18:13:56 UTC
*** Bug 1383985 has been marked as a duplicate of this bug. ***

Comment 9 Andrii Balakhtar 2016-10-19 10:29:21 UTC
FAILEDQA on Sat 6.3.0 Snap 4
Commands were added, --help returns valid information and even validation like missing org/errata ids are working. However, if you try to use the commands they're still broken:

hammer> host-collection erratum install --help
Usage:
     host-collection erratum install [OPTIONS]

Options:
 --errata ERRATA                         List of Errata to install
                                         Comma separated list of values.
 --id ID                                 Id of the host collection
 --name NAME                             Host collection name to search by
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by
 -h, --help                              print help

hammer> host-collection erratum install --id 1 --errata RHEA-2012:0055
Could not schedule installation of errata:
  Error: The server does not support such operation.


hammer> host-collection package install --help
Usage:
     host-collection package install [OPTIONS]

Options:
 --id ID                                 Id of the host collection
 --name NAME                             Host collection name to search by
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by
 --packages PACKAGES                     comma-separated list of packages to install
                                         Comma separated list of values.
 -h, --help                              print help

hammer> host-collection package install --id 1 --packages walrus-5.21-1.noarch
Could not schedule installation of package(s):
  Error: The server does not support such operation.

Comment 10 Brad Buckingham 2016-11-08 19:38:37 UTC
*** Bug 1392760 has been marked as a duplicate of this bug. ***

Comment 13 John Mitsch 2016-12-19 19:02:47 UTC
*** Bug 1395698 has been marked as a duplicate of this bug. ***

Comment 17 Andrew Kofink 2017-01-18 16:47:01 UTC
*** Bug 1405434 has been marked as a duplicate of this bug. ***

Comment 18 Andrew Kofink 2017-01-18 16:47:10 UTC
*** Bug 1405428 has been marked as a duplicate of this bug. ***

Comment 22 Andrii Balakhtar 2017-02-22 14:15:15 UTC
Verified on Sat 6.2.8 Snap3
Executed following commands:

hammer> host-collection package install --id 9 --organization-id 128 --packages bear
Successfully scheduled installation of package(s)
hammer> host-collection erratum install --errata RHBA-2016:1503 --id 9 --organization-id 128
Successfully scheduled installation of errata
hammer> host-collection package-group install --id 9 --organization-id 128 --package-groups birds
Successfully scheduled installation of package-group(s)
hammer> host-collection package-group remove --id 9 --organization-id 128 --package-groups birds
Successfully scheduled removal of package-groups(s)

And i'm able to see all the packages/package groups/errata installed/removed in all the hosts inside host-collection.

Comment 25 errata-xmlrpc 2017-03-06 08:44:46 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, 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/RHBA-2017:0446


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