Bug 1190021

Summary: Creating repository with docker content is failing
Product: Red Hat Satellite Reporter: Tazim Kolhar <tkolhar>
Component: HammerAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED NOTABUG QA Contact: Tazim Kolhar <tkolhar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: UnspecifiedCC: cwelton, kbidarka
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-06 11:24: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: 1190289    

Description Tazim Kolhar 2015-02-06 05:27:05 UTC
Description of problem:
Creating repository with docker content is failing

Version-Release number of selected component (if applicable):
# rpm -q foreman
foreman-1.7.2.3-1.el7sat.noarch


How reproducible:
everytime

Steps to Reproduce:
1.# hammer repository create --name test_dock --organization 'Default Organization' --product test_prod --url 'https://registry.hub.docker.com' --content-type 'docker'
[Foreman] Username: admin
[Foreman] Password for admin: 
Could not create the repository:
  Validation failed: Repository URL and Upstream Name cannot be empty. Both are required for syncing from the upstream.

2.
3.

Actual results:
repository creation failed

Expected results:
repository creation works as expected

Additional info:

Comment 1 RHEL Program Management 2015-02-06 05:43:19 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Kedar Bidarkar 2015-02-06 11:24:46 UTC
Looks like the following option was missing. 

--docker-upstream-name 'fedora'

I was able to create docker repo and start the sync too, so this is fine.

[root@xxxx yum.repos.d]# hammer repository create --name test_docker_fedora --organization-id 1 --product-id 1 --url 'https://registry.hub.docker.com/_/fedora/' --content-type 'docker' --docker-upstream-name 'fedora'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
[Foreman] Username: admin
[Foreman] Password for admin: 
Repository created
[root@xxxx yum.repos.d]# hammer -u admin -p changeme repository list --organization-id 1 --product-id 1
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
---|--------------------|--------------|--------------|------------------------------------------
ID | NAME               | PRODUCT      | CONTENT TYPE | URL                                      
---|--------------------|--------------|--------------|------------------------------------------
1  | docker_centos_repo | kbidarka_prd | docker       | https://registry.hub.docker.com/_/centos/
6  | test_docker        | kbidarka_prd | docker       | https://registry.hub.docker.com/_/centos/
7  | test_docker_fedora | kbidarka_prd | docker       | https://registry.hub.docker.com/_/fedora/
---|--------------------|--------------|--------------|------------------------------------------
[root@xxx yum.repos.d]# hammer -u admin -p changeme repository synchronize --id 7 --organization-id 1/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
[............................................................................                                                                                                         ] [42%]


will be moving to 'CLOSED NOTABUG'