Project

General

Profile

Actions

Bug #25793

closed

No validation on download policy for non-yum repositories

Added by Samir Jha over 5 years ago. Updated over 5 years ago.

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

Description

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

Description of problem:

Trying to create non-yum repositories via hammer did not throw exception if user specified on_demand download policy.

Version-Release number of selected component (if applicable):
Satellite 6.5 snap 5

How reproducible: always

Steps to Reproduce:
1. # hammer -v -u admin -p changeme --output=csv product create --description="aSTvrQbvLPZBmCPYlBce" --label="pdLSDBiObZmxSzcQzYhg" --name="YLqaeUGVtk" --organization-id="1"
Message,Id,Name
Product created.,71,YLqaeUGVtk

2. # hammer -v -u admin -p changeme --output=csv repository create --content-type="puppet" --download-policy="on_demand" --name="VBOjhSxRofEyePL" --product-id="71" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
Message,Id,Name
Repository created.,85,VBOjhSxRofEyePL

Actual results: No validation error.

Expected results: Should throw validation error.

Additional info:

On 6.4,

  1. hammer -v -u admin -p changeme --output=csv product create --description="aSTvrQbvLPZBmCPYlBce" --label="pdLSDBiObZmxSzcQzYhg" --name="YLqaeUGVtk" --organization-id="1"
    Message,Id,Name
    Product created,632,YLqaeUGVtk
  1. hammer -v -u admin -p changeme --output=csv repository create --content-type="puppet" --download-policy="on_demand" --name="VBOjhSxRofEyePL" --product-id="632" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
    [ERROR 2018-11-30T07:29:21 API] 422 Unprocessable Entity
    [ERROR 2018-11-30T07:29:21 Exception] Validation failed: Download policy cannot be set for non-yum repositories.
    Could not create the repository:
    Validation failed: Download policy cannot be set for non-yum repositories.
    [ERROR 2018-11-30T07:29:21 Exception]

RestClient::UnprocessableEntity (422 Unprocessable Entity):
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in `exception_with_response'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:103:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:353:in `block in rest_client_call_block'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:807:in `process_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:725:in `block in transmit'
/opt/rh/rh-ruby24/root/usr/share/ruby/net/http.rb:877:in `start'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:715:in `transmit'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:145:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:52:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/resource.rb:67:in `post'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:327:in `call_client'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:240:in `http_call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:190:in `call_action'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:185:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/resource.rb:21:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/apipie/command.rb:51:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.2.2/lib/hammer_cli_foreman/commands.rb:168:in `send_request'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/apipie/command.rb:34:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/bin/hammer:143:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'

Actions #1

Updated by Samir Jha over 5 years ago

  • Assignee set to Samir Jha
Actions #2

Updated by Samir Jha over 5 years ago

  • Found in Releases Katello 3.9.0 added
Actions #3

Updated by The Foreman Bot over 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7911 added
Actions #4

Updated by Anonymous over 5 years ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by Jonathon Turel over 5 years ago

  • Target version set to Katello 3.11.0
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF