Project

General

Profile

Bug #25628

Could not enable redhat repository using hammer cli

Added by Andrew Kofink 6 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

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

Description of problem:

Trying to enable repository using cli gives error

  1. hammer repository-set enable --name="Red Hat Enterprise Linux 7 Server (Kickstart)" --basearch="x86_64" --releasever="7.5" --product "Red Hat Enterprise Linux Server" --organization-id="1"
    Could not enable repository:
    One of parameters [ organization_id ] required but not specified.

Version-Release number of selected component (if applicable):
nightly/3.10

How reproducible: always

Steps to Reproduce:
1. hammer repository-set enable --name="Red Hat Enterprise Linux 7 Server (Kickstart)" --basearch="x86_64" --releasever="7.5" --product "Red Hat Enterprise Linux Server" --organization-id="1"

Actual results: Error Could not enable repository:
One of parameters [ organization_id ] required but not specified.

though organization-id is passed and production.log showed

2018-12-01T14:24:25 [I|app|] Started GET "/katello/api/organizations/1/products?name=Red+Hat+Enterprise+Linux+Server" for IP at 2018-12-01 14:24:25 -0500
2018-12-01T14:24:25 [I|app|1f209] Processing by Katello::Api::V2::ProductsController#index as JSON
2018-12-01T14:24:25 [I|app|1f209] Parameters: {"name"=>"Red Hat Enterprise Linux Server", "api_version"=>"v2", "organization_id"=>"1", "product"=>{}}
2018-12-01T14:24:25 [I|app|1f209] Authorized user admin(Admin User)
2018-12-01T14:24:25 [I|app|1f209] Current user set to admin (admin)
2018-12-01T14:24:25 [I|app|1f209] Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.rc1/app/views/katello/api/v2/products/index.json.rabl within katello/api/v2/layouts/collection
2018-12-01T14:24:25 [I|app|1f209] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.rc1/app/views/katello/api/v2/products/index.json.rabl within katello/api/v2/layouts/collection (47.6ms)
2018-12-01T14:24:25 [I|app|1f209] Completed 200 OK in 83ms (Views: 43.3ms | ActiveRecord: 15.9ms)
2018-12-01T14:24:25 [I|app|] Started GET "/katello/api/repository_sets?name=Red+Hat+Enterprise+Linux+7+Server+%28RPMs%29" for IP at 2018-12-01 14:24:25 -0500
2018-12-01T14:24:25 [I|app|f7910] Processing by Katello::Api::V2::RepositorySetsController#index as JSON
2018-12-01T14:24:25 [I|app|f7910] Parameters: {"name"=>"Red Hat Enterprise Linux 7 Server (RPMs)", "api_version"=>"v2", "repository_set"=>{}}
2018-12-01T14:24:25 [I|app|f7910] Authorized user admin(Admin User)
2018-12-01T14:24:25 [I|app|f7910] Current user set to admin (admin)
2018-12-01T14:24:25 [E|app|f7910] Katello::HttpErrors::NotFound: One of parameters [ organization_id ] required but not specified.
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.rc1/app/controllers/katello/api/v2/api_controller.rb:135:in `find_organization'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.rc1/app/controllers/katello/api/v2/repository_sets_controller.rb:138:in `find_product_or_organization'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:426:in `block in make_lambda'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:199:in `block in halting'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:513:in `invoke_before'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:107:in `block in run_callbacks'
/usr/share/foreman/app/controllers/api/v2/base_controller.rb:163:in `disable_json_root'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in `set_timezone'

Expected results: repository should enable.

Additional info:

Associated revisions

Revision 1843e9d3 (diff)
Added by Andrew Kofink 5 months ago

Fixes #25628: Resolve repo set id by org/product (#606)

  • Bump apipie cache to 3.11
  • Fixes #25628: Resolve repo set id by org/product

Resolve repository set IDs from repository set name and one of
organization or product. Require organization or product if repository
set name is provided.

Add repository set tests.

History

#1 Updated by Andrew Kofink 6 months ago

  • Difficulty set to easy
  • Target version set to Katello 3.10.1
  • Subject changed from Could not enable redhat repository using hammer cli to Could not enable redhat repository using hammer cli

#2 Updated by The Foreman Bot 6 months ago

  • Assignee set to Andrew Kofink
  • Pull request https://github.com/Katello/hammer-cli-katello/pull/606 added

#3 Updated by Andrew Kofink 6 months ago

  • Triaged changed from No to Yes

#4 Updated by The Foreman Bot 6 months ago

  • Status changed from New to Ready For Testing

#5 Updated by Anonymous 5 months ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Jonathon Turel about 2 months ago

  • Target version changed from Katello 3.10.1 to Katello 3.11.0
  • Found in Releases Katello 3.10.0 added
  • Fixed in Releases Katello 3.11.0 added

Also available in: Atom PDF