Project

General

Profile

Bug #28178

Repository create with http_proxy name fails with Error: Found more than one http_proxy.

Added by Vijay Singh over 1 year ago. Updated about 1 year ago.

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

Description

Repository create with http_proxy name fails with Error: Found more than one http_proxy.

Steps:

hammer> repository create --name RenuRani7 --product-id 1 --content-type yum --url 'https://repos.fedorapeople.org/repos/pulp/pulp/fixtures/srpm/' --http-proxy TestProxy --http-proxy-policy use_selected_http_proxy
Could not create the repository:
  Error: Found more than one http_proxy.
hammer>

Actual Result:

Error: Found more than one http_proxy.

Expected Result:

Able to create Repository using http_proxy name.

Related issues

Related to Katello - Tracker #28179: [Tracker] Content Mgmt: http_proxy issuesNew

Associated revisions

Revision 1d3e98bf (diff)
Added by Chris Roberts over 1 year ago

Fixes #28178 - Correct http_proxy search by name

History

#1 Updated by Vijay Singh over 1 year ago

  • Related to Tracker #28179: [Tracker] Content Mgmt: http_proxy issues added

#2 Updated by James Jeffers over 1 year ago

  • Assignee deleted (James Jeffers)

Reproduced this with 2 http proxies - "TestProxy" and "TestProxy2". Using hammer

hammer repository create --name VijayTest2 --product-id 2 --content-type yum --url 'https://repos.fedorapeople.org/repos/pulp/pulp/fixtures/srpm/' --http-proxy TestProxy --http-proxy-policy use_selected_http_proxy

Hammer invokes an API request:

14:13:21 rails.1   | 2019-11-01T14:13:21 [I|app|b1971d02] Started GET "/api/http_proxies?name=TestProxy&per_page=1000&page=1" for 192.168.121.219 at 2019-11-01 14:13:21 +0000
14:13:21 rails.1   | 2019-11-01T14:13:21 [I|app|b1971d02] Processing by Api::V2::HttpProxiesController#index as JSON
14:13:21 rails.1   | 2019-11-01T14:13:21 [I|app|b1971d02]   Parameters: {"name"=>"TestProxy", "per_page"=>"1000", "page"=>"1", "apiv"=>"v2", "http_proxy"=>{}}
14:13:21 rails.1   | 2019-11-01T14:13:21 [D|app|b1971d02] Authenticated user admin against INTERNAL authentication source
14:13:21 rails.1   | 2019-11-01T14:13:21 [I|app|b1971d02] Authorized user admin(Admin User)
14:13:21 rails.1   | 2019-11-01T14:13:21 [D|tax|b1971d02] Current location set to none
14:13:21 rails.1   | 2019-11-01T14:13:21 [D|tax|b1971d02] Current organization set to none
14:13:21 rails.1   | 2019-11-01T14:13:21 [D|tax|b1971d02] Current location set to none
14:13:21 rails.1   | 2019-11-01T14:13:21 [D|tax|b1971d02] Current organization set to none
14:13:21 rails.1   | 2019-11-01T14:13:21 [I|app|b1971d02]   Rendering api/v2/http_proxies/index.json.rabl within api/v2/layouts/index_layout
14:13:21 rails.1   | 2019-11-01T14:13:21 [I|app|b1971d02]   Rendered api/v2/http_proxies/index.json.rabl within api/v2/layouts/index_layout (17.0ms)
14:13:21 rails.1   | 2019-11-01T14:13:21 [D|app|b1971d02] Body: {
14:13:21 rails.1   |  |   "total": 2,
14:13:21 rails.1   |  |   "subtotal": 2,
14:13:21 rails.1   |  |   "page": 1,
14:13:21 rails.1   |  |   "per_page": 1000,
14:13:21 rails.1   |  |   "search": null,
14:13:21 rails.1   |  |   "sort": {
14:13:21 rails.1   |  |     "by": null,
14:13:21 rails.1   |  |     "order": null
14:13:21 rails.1   |  |   },
14:13:21 rails.1   |  |   "results": [{"id":1,"name":"TestProxy","url":"http://192.168.1.112","username":"admin"},{"id":2,"name":"TestProxy2","url":"http://192.168.1.121:8888","username":""}]
14:13:21 rails.1   |  | }

While the parameter is actually the name of one of the http proxies, the list returned is actually all http proxies that match that name. The supplied name is a search, and not a unique identifier according to how the API controller is implemented.

See https://github.com/theforeman/foreman/blob/develop/app/controllers/api/v2/http_proxies_controller.rb.

#3 Updated by Justin Sherrill over 1 year ago

  • Triaged changed from No to Yes
  • Target version set to Katello Backlog

#4 Updated by James Jeffers over 1 year ago

  • Bugzilla link set to 1777720

#5 Updated by The Foreman Bot over 1 year ago

  • Target version deleted (Katello Backlog)
  • Assignee set to Chris Roberts
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/hammer-cli-katello/pull/711 added

#6 Updated by Chris Roberts over 1 year ago

  • Status changed from Ready For Testing to Closed

#7 Updated by Jonathon Turel about 1 year ago

  • Target version set to Katello 3.15.0

Also available in: Atom PDF