Bug 1372372

Summary: hammer host collection package/erratum subcommands are broken
Product: Red Hat Satellite Reporter: Andrii Balakhtar <abalakht>
Component: Host CollectionsAssignee: Andrew Kofink <akofink>
Status: CLOSED ERRATA QA Contact: Andrii Balakhtar <abalakht>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0CC: akofink, bbuckingham, bkearney, dlezzoum, ehelms, ktordeur, mmccune, nshaik, pmoravec, rankumar, rochacbruno, swadeley, wpinheir
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-katello-3.0.0.98-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1417115 (view as bug list) Environment:
Last Closed: 2017-03-06 08:44:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1377245, 1417115    

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