Bug 1103944
| Summary: | Need to be able to associate gpg key to a repository by gpg key name | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Partha Aji <paji> |
| Component: | Hammer | Assignee: | Adam Price <adprice> |
| Status: | CLOSED WORKSFORME | QA Contact: | Sachin Ghai <sghai> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.0.3 | CC: | bbuckingham, bkearney, cwelton, erezende, mmccune, sghai, sthirugn |
| Target Milestone: | Unspecified | Keywords: | Regression, Reopened, Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://projects.theforeman.org/issues/6028 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-04-09 11:02:17 UTC | Type: | --- |
| 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: | 1103945 | ||
| Bug Blocks: | |||
|
Description
Partha Aji
2014-06-03 00:33:48 UTC
Created from redmine issue http://projects.theforeman.org/issues/6028 Upstream bug assigned to paji This is awaiting fixes being worked on here: http://projects.theforeman.org/issues/5747 Test Scenario 1: # hammer repository create --product-id='94' --name='newrepo' --publish-via-http='true' --url='**valid url**' --gpg-key='testgpgkey' --content-type='yum' Repository created # hammer repository list --organization=ACME_Corporation ---|------------------------------------------------------------|------------- ID | NAME | CONTENT TYPE ---|------------------------------------------------------------|------------- 11 | newrepo | yum ---|------------------------------------------------------------|------------- # hammer repository info --id=11 ID: 11 Name: newrepo Label: newrepo Organization: ACME_Corporation Red Hat Repository: no Content Type: yum URL: **** Publish Via HTTP: yes Published At: http://host/pulp/repos/ACME_Corporation/Library/custom/product1/newrepo Product: ID: 94 Name: product1 GPG Key: ID: 1 Name: testgpgkey Sync: Status: Not Synced Created: 2014/06/12 17:29:52 Updated: 2014/06/12 17:29:55 Content Counts: Test Scenario 2: # hammer repository create --product-id='94' --name='newtestrepo' --publish-via-http='true' --url='*valid url' --gpg-key-id=1 --content-type='yum' Repository created # hammer repository list --organization=ACME_Corporation ---|------------------------------------------------------------|------------- ID | NAME | CONTENT TYPE ---|------------------------------------------------------------|------------- 11 | newrepo | yum 12 | newtestrepo | yum ---|------------------------------------------------------------|------------- # hammer repository info --id=12 ID: 12 Name: newtestrepo Label: newtestrepo Organization: ACME_Corporation Red Hat Repository: no Content Type: yum URL: **** Publish Via HTTP: yes Published At: http://host/pulp/repos/ACME_Corporation/Library/custom/product1/newtestrepo Product: ID: 94 Name: product1 GPG Key: ID: 1 Name: testgpgkey Sync: Status: Not Synced Created: 2014/06/12 17:36:22 Updated: 2014/06/12 17:36:25 Content Counts: Version Tested: * apr-util-ldap-1.3.9-3.el6_0.1.x86_64 * candlepin-0.9.7-1.el6_5.noarch * candlepin-scl-1-5.el6_4.noarch * candlepin-scl-quartz-2.1.5-5.el6_4.noarch * candlepin-scl-rhino-1.7R3-1.el6_4.noarch * candlepin-scl-runtime-1-5.el6_4.noarch * candlepin-selinux-0.9.7-1.el6_5.noarch * candlepin-tomcat6-0.9.7-1.el6_5.noarch * elasticsearch-0.90.10-4.el6sat.noarch * foreman-1.6.0.16-1.el6sat.noarch * foreman-compute-1.6.0.16-1.el6sat.noarch * foreman-gce-1.6.0.16-1.el6sat.noarch * foreman-libvirt-1.6.0.16-1.el6sat.noarch * foreman-ovirt-1.6.0.16-1.el6sat.noarch * foreman-postgresql-1.6.0.16-1.el6sat.noarch * foreman-proxy-1.6.0.7-1.el6sat.noarch * foreman-selinux-1.6.0-4.el6sat.noarch * foreman-vmware-1.6.0.16-1.el6sat.noarch * katello-1.5.0-25.el6sat.noarch * katello-ca-1.0-1.noarch * katello-certs-tools-1.5.5-1.el6sat.noarch * katello-installer-0.0.48-1.el6sat.noarch * openldap-2.4.23-32.el6_4.1.x86_64 * openldap-devel-2.4.23-32.el6_4.1.x86_64 * pulp-katello-0.3-3.el6sat.noarch * pulp-nodes-common-2.4.0-0.20.beta.el6sat.noarch * pulp-nodes-parent-2.4.0-0.20.beta.el6sat.noarch * pulp-puppet-plugins-2.4.0-0.20.beta.el6sat.noarch * pulp-puppet-tools-2.4.0-0.20.beta.el6sat.noarch * pulp-rpm-plugins-2.4.0-0.20.beta.el6sat.noarch * pulp-selinux-2.4.0-0.20.beta.el6sat.noarch * pulp-server-2.4.0-0.20.beta.el6sat.noarch * python-ldap-2.3.10-1.el6.x86_64 * ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch * ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch # LANG=en_US hammer -v -u admin -p changeme --output csv organization create --name='1wd68kt3'
Message,Id,Name
Organization created,167,1wd68kt3
# LANG=en_US hammer -v -u admin -p changeme organization info --id='167'
Id: 167
Name: 1wd68kt3
Users:
Smart proxies:
somehost.com
Subnets:
Compute resources:
Installation media:
Templates:
Domains:
Environments:
Hostgroups:
Parameters:
Created at: 2014/06/27 16:32:12
Updated at: 2014/06/27 16:32:14
Label: 1wd68kt3
Description:
Red Hat Repository URL: https://cdn.redhat.com
# LANG=en_US hammer -v -u admin -p changeme --output csv product create --description='CoacLBSeiqNOpNoIcurF' --label='pzWiYtjcUQhSLiPxJtig' --organization-id='167' --name='DKKRSTdvnLJgqLwTeCqL'
Message,Id,Name
Product created,86,DKKRSTdvnLJgqLwTeCqL
# LANG=en_US hammer -v -u admin -p changeme product info --id='86' --organization-id='167'
ID: 86
Name: DKKRSTdvnLJgqLwTeCqL
Label: pzWiYtjcUQhSLiPxJtig
Description: CoacLBSeiqNOpNoIcurF
Sync State: not_synced
Sync Plan ID:
GPG:
GPG Key ID:
GPG Key:
Organization: 1wd68kt3
Readonly: false
Deletable: true
Content:
# LANG=en_US hammer -v -u admin -p changeme --output csv gpg create --organization-id='167' --name='42ou' --key='/tmp/h6gpxkr'
Message,Id,Name
GPG Key created,56,42ou
# LANG=en_US hammer -v -u admin -p changeme --output csv gpg info --id='56' --organization-id='167'
ID,Name,Organization,Content
56,42ou,1wd68kt3,9sdajdvql0o5yvqu0lcekhhfs6zqqc9zy
# LANG=en_US hammer -v -u admin -p changeme --output csv repository create --product-id='86' --name='794327675264689' --publish-via-http='true' --url='http://somehost.org/fakerepo01/' --gpg-key='42ou' --content-type='yum'
Message,Id,Name
Repository created,104,794327675264689
# LANG=en_US hammer -v -u admin -p changeme repository info --id='104'
ID: 104
Name: 794327675264689
Label: 794327675264689
Organization: 1wd68kt3
Red Hat Repository: no
Content Type: yum
URL: http://somehost.org/fakerepo01/
Publish Via HTTP: yes
Published At: http://somehost.com/pulp/repos/1wd68kt3/Library/custom/pzWiYtjcUQhSLiPxJtig/794327675264689
Product:
ID: 86
Name: DKKRSTdvnLJgqLwTeCqL
GPG Key:
Sync:
Status: Not Synced
Created: 2014/06/27 16:33:15
Updated: 2014/06/27 16:33:18
Content Counts:
As demonstrated in the last comment, GPG key is not being associated to a repository again. Moving this to assigned. Workaround: Using gpg key name fails but using gpg key id works - See below for the illustration of using gpg key id # hammer repository create --product-id=10 --name='brandrepo2' --publish-via-http='true' --url='**url**' --gpg-key-id='1' --content-type='yum' Repository created # hammer repository list --organization='ACME_Corporation' ---|------------------------------------------------------------|------------- ID | NAME | CONTENT TYPE ---|------------------------------------------------------------|------------- 11 | brandrepo2 | yum ---|------------------------------------------------------------|------------- # hammer repository info --id=11 ID: 11 Name: brandrepo2 Label: brandrepo2 Organization: ACME_Corporation Red Hat Repository: no Content Type: yum URL: **url** Publish Via HTTP: yes Published At: http://host/pulp/repos/ACME_Corporation/Library/custom/satellite6/brandrepo2 Product: ID: 10 Name: satellite6 GPG Key: ID: 1 Name: key1 Sync: Status: Not Synced Created: 2014/06/27 17:34:48 Updated: 2014/06/27 17:34:51 Content Counts: appears to be working for me # hammer repository create --organization adamprice --url "*** valid url ***" --product prod1 --name repo1 --publish-via-http 1 --content-type yum --gpg-key key1 Repository created # hammer repository info --organization adamprice --name repo1 --product prod1 ID: 1 Name: repo1 Label: repo1 Organization: adamprice Red Hat Repository: no Content Type: yum URL: *** valid url *** Publish Via HTTP: yes Published At: http://FQDN/pulp/repos/adamprice/Library/custom/prod1/repo1 Product: ID: 9 Name: prod1 GPG Key: ID: 1 Name: key1 Sync: Status: Created: 2015/01/26 20:39:21 Updated: 2015/01/26 20:39:26 Content Counts: Packages: 0 Package Groups: 0 Errata: 0 Verified with: Satellite-6.1.0-RHEL-6-20150210.0 Sat6.1.0 beta snap2 Now gpg_key can be associated to repository by gpgkey name. [root@dhcp201-167 ~]# hammer --username admin --password changeme gpg list --organization-id=3 /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 ---|------ 1 | g_key ---|------ [root@dhcp201-167 ~]# hammer --username admin --password changeme product list --organization-id=3 ----|------|-------------|--------------|--------------|----------- ID | NAME | DESCRIPTION | ORGANIZATION | REPOSITORIES | SYNC STATE ----|------|-------------|--------------|--------------|----------- 114 | p1 | | testorg | 0 | not_synced ----|------|-------------|--------------|--------------|----------- [root@dhcp201-167 ~]# hammer --username admin --password changeme repository create --url='http://omaciel.fedorapeople.org/fakerepo01/' --product-id='114' --name='r1' --publish-via-http=1 --content-type='yum' --gpg-key=g_key --organization-id=3 Repository created [root@dhcp201-167 ~]# hammer --username admin --password changeme product list --organization-id=3 ----|------|-------------|--------------|--------------|----------- ID | NAME | DESCRIPTION | ORGANIZATION | REPOSITORIES | SYNC STATE ----|------|-------------|--------------|--------------|----------- 114 | p1 | | testorg | 1 | not_synced ----|------|-------------|--------------|--------------|----------- [root@dhcp201-167 ~]# hammer --username admin --password changeme repository list --organization-id=3 ---|------|---------|--------------|-------------------------------------------- ID | NAME | PRODUCT | CONTENT TYPE | URL ---|------|---------|--------------|-------------------------------------------- 8 | r1 | p1 | yum | http://omaciel.fedorapeople.org/fakerepo01/ ---|------|---------|--------------|-------------------------------------------- [root@dhcp201-167 ~]# hammer --username admin --password changeme repository info --id 8 ID: 8 Name: r1 Label: r1 Organization: testorg Red Hat Repository: no Content Type: yum URL: http://omaciel.fedorapeople.org/fakerepo01/ Publish Via HTTP: yes Published At: http://dhcp201-167.englab.pnq.redhat.com/pulp/repos/testorg/Library/custom/p1/r1 Product: ID: 114 Name: p1 GPG Key: ID: 1 Name: g_key Sync: Status: Created: 2015/02/13 01:23:27 Updated: 2015/02/13 01:23:31 Content Counts: Packages: 0 Package Groups: 0 Errata: 0 Automation got this as regression again, see the steps below:
# LANG=en_US.UTF-8 hammer -v -u admin -p changeme --output=csv organization create --name="M0vU9Y"
Message,Id,Name
Organization created,561,M0vU9Y
# LANG=en_US.UTF-8 hammer -v -u admin -p changeme organization info --id="561"
Id: 561
Name: M0vU9Y
Users:
Smart proxies:
sat6.example.com
Subnets:
Compute resources:
Installation media:
Templates:
Boot disk iPXE - generic host (Bootdisk)
Boot disk iPXE - host (Bootdisk)
idm_register ()
Kickstart default iPXE (iPXE)
Kickstart default PXELinux (PXELinux)
kickstart_networking_setup ()
puppet.conf ()
PXELinux default local boot (PXELinux)
PXELinux global default (PXELinux)
Satellite Kickstart Default (provision)
Satellite Kickstart Default Finish (finish)
Satellite Kickstart Default User Data (user_data)
subscription_manager_registration ()
Domains:
Environments:
Hostgroups:
Parameters:
Created at: 2015/04/02 01:17:02
Updated at: 2015/04/02 01:17:02
Label: M0vU9Y
Description:
Red Hat Repository URL: https://cdn.redhat.com
# LANG=en_US.UTF-8 hammer -v -u admin -p changeme --output=csv product create --organization-id="561" --description="cBCnGqcbOruTIlxpfLdt" --name="NijEpmtIwjgGAcPWdohe" --label="NzIWdeiTJceNySAirQBu"
Message,Id,Name
Product created,2469,NijEpmtIwjgGAcPWdohe
# LANG=en_US.UTF-8 hammer -v -u admin -p changeme product info --id="2469" --organization-id="561"
ID: 2469
Name: NijEpmtIwjgGAcPWdohe
Label: NzIWdeiTJceNySAirQBu
Description: cBCnGqcbOruTIlxpfLdt
Sync State: not_synced
Sync Plan ID:
GPG:
GPG Key ID:
GPG Key:
Organization: M0vU9Y
Readonly: false
Deletable:
Content:
# LANG=en_US.UTF-8 hammer -v -u admin -p changeme --output=csv gpg create --organization-id="561" --name="8KFXTy9PCs" --key="/tmp/bt7hyehMbE"
Message,Id,Name
GPG Key created,64,8KFXTy9PCs
# LANG=en_US.UTF-8 hammer -v -u admin -p changeme --output=csv gpg info --id="64" --organization-id="561"
ID,Name,Organization,Content
64,8KFXTy9PCs,M0vU9Y,HseUq9bGAzmJFbaqwhQC04lF6iND9eyoQNeOt9
# LANG=en_US.UTF-8 hammer -v -u admin -p changeme --output=csv repository create --product-id="2469" --name="izupyLoDyChcuBG" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/" --gpg-key="8KFXTy9PCs" --content-type="yum"
Message,Id,Name
Repository created,373,izupyLoDyChcuBG
# LANG=en_US.UTF-8 hammer -v -u admin -p changeme repository info --id="373"
ID: 373
Name: izupyLoDyChcuBG
Label: izupyLoDyChcuBG
Organization: M0vU9Y
Red Hat Repository: no
Content Type: yum
URL: http://inecas.fedorapeople.org/fakerepos/zoo3/
Publish Via HTTP: yes
Published At: http://sat6.example.com/pulp/repos/M0vU9Y/Library/custom/NzIWdeiTJceNySAirQBu/izupyLoDyChcuBG
Product:
ID: 2469
Name: NijEpmtIwjgGAcPWdohe
GPG Key:
Sync:
Status:
Created: 2015/04/02 01:17:32
Updated: 2015/04/02 01:17:33
Content Counts:
Packages: 0
Errata: 0
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/RHSA-2015:1592 Reopened as per Comment 15 Upstream bug component is Hammer Upstream bug component is Content Management Upstream bug component is Hammer Upstream bug assigned to adprice I attempted this on Satellite 6.2 SNAP 6.1 and it appears to be working correctly. # hammer organization create --name acme Organization created # hammer product create --organization acme --name product1 Product created # vim fake.key # hammer gpg create --organization acme --name fakekey1 --key fake.key GPG Key created # hammer repository create --organization acme --product product1 --name repo1 --publish-via-http true --url http://inecas.fedorapeople.org/fakerepos/zoo3/ --gpg-key fakekey1 --content-type yum Repository created # hammer repository info --organization acme --product product1 --name repo1 ID: 1 Name: repo1 Label: repo1 Organization: acme Red Hat Repository: no Content Type: yum URL: http://inecas.fedorapeople.org/fakerepos/zoo3/ Publish Via HTTP: yes Published At: http://sat6.example.com/pulp/repos/acme/Library/custom/product1/repo1 Relative Path: acme/Library/custom/product1/repo1 Download Policy: on_demand Product: ID: 1 Name: product1 GPG Key: ID: 1 Name: fakekey1 Sync: Status: Not Synced Created: 2016/04/05 21:43:44 Updated: 2016/04/05 21:43:46 Content Counts: Packages: 0 Package Groups: 0 Errata: 0 Verified with sat6.2 beta snap6.2 I can associate gpgkey by name to selected repository [root@qe-sat6-rhel7 ~]# hammer -u admin -p changeme organization create --name acme Organization created [root@qe-sat6-rhel7 ~]# hammer -u admin -p changeme product create --organization acme --name product1 Product created [root@qe-sat6-rhel7 ~]# hammer -u admin -p changeme gpg create --organization acme --name fakekey1 --key fake.key GPG Key created [root@qe-sat6-rhel7 ~]# hammer -u admin -p changeme repository create --organization acme --product product1 --name repo1 --publish-via-http true --url http://inecas.fedorapeople.org/fakerepos/zoo3/ --gpg-key fakekey1 --content-type yum Repository created [root@qe-sat6-rhel7 ~]# hammer -u admin -p changeme repository info --organization acme --product product1 --name repo1 ID: 673 Name: repo1 Label: repo1 Organization: acme Red Hat Repository: no Content Type: yum URL: http://inecas.fedorapeople.org/fakerepos/zoo3/ Publish Via HTTP: yes Published At: http://qe-sat6-rhel7.satqe.lab.eng.rdu2.redhat.com/pulp/repos/acme/Library/custom/product1/repo1 Relative Path: acme/Library/custom/product1/repo1 Download Policy: immediate Product: ID: 667 Name: product1 GPG Key: ID: 82 Name: fakekey1 Sync: Status: Not Synced Created: 2016/04/09 10:58:44 Updated: 2016/04/09 10:58:45 Content Counts: Packages: 0 Package Groups: 0 Errata: 0 |