Project

General

Profile

Bug #6023

Cannot associate a gpg key to a repository

Added by Partha Aji about 5 years ago. Updated about 1 year ago.

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

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1083236
Description of problem:

This affects both UI and CLI. Trying to associate an existing gpg key to a repository does not "save" and the repository remains without a gpg key.

[root@qeblade35 ~]# LANG=en_US hammer -v -u admin -p changeme --output csv repository create --feed='http://omaciel.fedorapeople.org/fakerepo01/' --gpg-key-name='qbsc82ec' --product-id='90' --name='foobar1' --publish-via-http='true' --enabled='true' --content-type='yum'
Message,Id,Name
Repository created,92,foobar1
[root@qeblade35 ~]# hammer repository info --id 92
ID: 92
Name: foobar1
Label: foobar1
Organization: ACME_Corporation
Enabled: yes
Red Hat Repository: no
Type: yum
URL: http://omaciel.fedorapeople.org/fakerepo01/
Publish Via HTTP: no
Published At: https://qeblade35.rhq.lab.eng.bos.redhat.com/pulp/repos/ACME_Corporation/Library/custom/Bogus/foobar1
Product:
ID: 90
Name: Bogus
GPG Key:

Sync:
Status: Not Synced
Created: 2014/04/01 18:06:20
Updated: 2014/04/01 18:06:24
Content Counts:

[root@qeblade35 ~]# LANG=en_US hammer -v -u admin -p changeme --output csv repository create --feed='http://omaciel.fedorapeople.org/fakerepo01/' --gpg-key-name='qbsc82ec' --product-id='90' --name='foobar2' --publish-via-http='yes' --enabled='true' --content-type='yum'
Message,Id,Name
Repository created,93,foobar2
[root@qeblade35 ~]# hammer repository info --id 93
ID: 93
Name: foobar2
Label: foobar2
Organization: ACME_Corporation
Enabled: yes
Red Hat Repository: no
Type: yum
URL: http://omaciel.fedorapeople.org/fakerepo01/
Publish Via HTTP: no
Published At: https://qeblade35.rhq.lab.eng.bos.redhat.com/pulp/repos/ACME_Corporation/Library/custom/Bogus/foobar2
Product:
ID: 90
Name: Bogus
GPG Key:

Sync:
Status: Not Synced
Created: 2014/04/01 18:07:00
Updated: 2014/04/01 18:07:04
Content Counts:

[root@qeblade35 ~]# LANG=en_US hammer -v -u admin -p changeme --output csv repository create --feed='http://omaciel.fedorapeople.org/fakerepo01/' --gpg-key-name='qbsc82ec' --product-id='90' --name='foobar3' --publish-via-http=1 --enabled='true' --content-type='yum'
Message,Id,Name
Repository created,94,foobar3
[root@qeblade35 ~]# hammer repository info --id 94
ID: 94
Name: foobar3
Label: foobar3
Organization: ACME_Corporation
Enabled: yes
Red Hat Repository: no
Type: yum
URL: http://omaciel.fedorapeople.org/fakerepo01/
Publish Via HTTP: no
Published At: https://qeblade35.rhq.lab.eng.bos.redhat.com/pulp/repos/ACME_Corporation/Library/custom/Bogus/foobar3
Product:
ID: 90
Name: Bogus
GPG Key:

Sync:
Status: Not Synced
Created: 2014/04/01 18:07:33
Updated: 2014/04/01 18:07:36
Content Counts:

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

  • 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.5.0.13-1.el6sat.git.0.8bc20ed.noarch
  • foreman-compute-1.5.0.13-1.el6sat.git.0.8bc20ed.noarch
  • foreman-libvirt-1.5.0.13-1.el6sat.git.0.8bc20ed.noarch
  • foreman-postgresql-1.5.0.13-1.el6sat.git.0.8bc20ed.noarch
  • foreman-proxy-1.5.4-1.el6sat.noarch
  • foreman-selinux-1.5.0-0.develop.el6sat.noarch
  • katello-1.5.0-19.el6sat.noarch
  • katello-apache-1.0-1.noarch
  • katello-ca-1.0-1.noarch
  • katello-certs-tools-1.5.5-1.el6sat.noarch
  • katello-installer-0.0.31-1.el6sat.noarch
  • openldap-2.4.23-32.el6_4.1.x86_64
  • pulp-katello-plugins-0.2-1.el6sat.noarch
  • pulp-nodes-common-2.3.1-0.4.beta.el6sat.noarch
  • pulp-nodes-parent-2.3.1-0.4.beta.el6sat.noarch
  • pulp-puppet-plugins-2.3.1-0.4.beta.el6sat.noarch
  • pulp-rpm-plugins-2.3.1-0.4.beta.el6sat.noarch
  • pulp-selinux-2.3.1-0.4.beta.el6sat.noarch
  • pulp-server-2.3.1-0.4.beta.el6sat.noarch
  • python-ldap-2.3.10-1.el6.x86_64
  • ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
  • ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
  • ruby193-rubygem-runcible-1.0.8-1.el6sat.noarch
  • rubygem-hammer_cli-0.1.0-4.el6sat.noarch
  • rubygem-hammer_cli_foreman-0.1.0-5.el6sat.noarch
  • rubygem-hammer_cli_foreman_tasks-0.0.2-2.el6sat.noarch
  • rubygem-hammer_cli_katello-0.0.3-11.el6sat.noarch

How reproducible:

Steps to Reproduce:
1. Add a new gpg key to an existing custom product
2. Create a new repo and associate the gpg key to it
3. Save the repo

Actual results:

The gpg key does not get associated with the repository

Expected results:

Additional info:

> /var/log/foreman/production.log <
Processing by Apipie::ApipiesController#apipie_checksum as JSON
Parameters: {"apipy"=>{}}
Rendered /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.1.2/app/views/apipie/apipies/apipie_checksum.json.erb (0.6ms)
Completed 200 OK in 156ms (Views: 155.4ms | ActiveRecord: 0.0ms)
Processing by Apipie::ApipiesController#apipie_checksum as JSON
Parameters: {"apipy"=>{}}
Rendered /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.1.2/app/views/apipie/apipies/apipie_checksum.json.erb (0.1ms)
Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::V2::RepositoriesController#create as application/json;version=2
Parameters: {"content_type"=>"yum", "product_id"=>"90", "url"=>"http://omaciel.fedorapeople.org/fakerepo01/", "gpg_key_name"=>"qbsc82ec", "name"=>"vJfQQYnxXPpSWuY", "enabled"=>"true", "api_version"=>"v2", "repository"=>{"name"=>"vJfQQYnxXPpSWuY", "enabled"=>"true", "content_type"=>"yum", "product_id"=>"90"}}
Expire fragment views/tabs_and_title_records-1 (0.1ms)
Authorized user admin(Admin User) > /var/log/candlepin/candlepin.log <
2014-04-01 14:17:02,455 [req=99519310-26f1-4f0b-abfa-1c02abdd4e1a, org=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Request: verb=GET, uri=/candlepin/products/1396291309300
2014-04-01 14:17:02,464 [req=99519310-26f1-4f0b-abfa-1c02abdd4e1a, org=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Response: status=200, content-type="application/json", time=9ms
2014-04-01 14:17:04,256 [req=4ca103e1-2b08-4a48-bdcc-6dcf722ab3c2, org=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Request: verb=POST, uri=/candlepin/content/
2014-04-01 14:17:04,273 [req=4ca103e1-2b08-4a48-bdcc-6dcf722ab3c2, org=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Response: status=200, content-type="application/json", time=56ms
2014-04-01 14:17:04,346 [req=e4b609e7-3956-499e-bb1e-4fc71051bb3b, org=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Request: verb=POST, uri=/candlepin/products/1396291309300/content/1396376224261?enabled=true
2014-04-01 14:17:04,360 [req=e4b609e7-3956-499e-bb1e-4fc71051bb3b, org=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Response: status=200, content-type="application/json", time=14ms
2014-04-01 14:17:04,428 [req=34d8e941-3dc6-4252-a8a4-7c6c43e2254c, org=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Request: verb=GET, uri=/candlepin/environments/1
2014-04-01 14:17:04,451 [req=34d8e941-3dc6-4252-a8a4-7c6c43e2254c, org=ACME_Corporation] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Response: status=200, content-type="application/json", time=23ms
2014-04-01 14:17:04,514 [req=d7fce308-ee8c-42c4-8007-98857f274a98, org=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Request: verb=POST, uri=/candlepin/environments/1/content
2014-04-01 14:17:04,557 [req=d7fce308-ee8c-42c4-8007-98857f274a98, org=ACME_Corporation] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Response: status=202, content-type="application/json", time=82ms
2014-04-01 14:17:04,581 [job=regen_entitlement_cert_of_envb4489bd7-e2ec-48ac-930c-6f3619522368, org=] INFO org.candlepin.controller.CandlepinPoolManager - Regenerating relevant certificates in environment: 1
2014-04-01 14:17:04,594 [job=regen_entitlement_cert_of_envb4489bd7-e2ec-48ac-930c-6f3619522368, org=] INFO org.candlepin.controller.CandlepinPoolManager - Found 0 certificates to regenerate. > /var/log/pulp/pulp.log <
2014-04-01 14:17:04,881 pulp.plugins.pulp_rpm.yum_plugin.metadata:INFO: generate_yum_metadata finished processing 0 units
2014-04-01 14:17:06,513 pulp.plugins.pulp_rpm.yum_plugin.metadata:INFO: comps xml path does not exist; skipping merge
2014-04-01 14:17:06,513 pulp.plugins.pulp_rpm.yum_plugin.metadata:INFO: updateinfo xml path does not exist; skipping merge
2014-04-01 14:17:06,514 pulp.plugins.pulp_rpm.yum_plugin.metadata:INFO: check scratchpad for any repodata
2014-04-01 14:17:06,514 pulp.plugins.pulp_rpm.yum_plugin.metadata:INFO: Metadata generation finished in 1.63879990578 seconds
2014-04-01 14:17:06,516 pulp.plugins.yum_distributor.distributor:INFO: HTTPS Publishing repo <ACME_Corporation-Bogus-vJfQQYnxXPpSWuY> to </var/lib/pulp/published/https/repos/ACME_Corporation/Library/custom/Bogus/vJfQQYnxXPpSWuY>
2014-04-01 14:17:06,518 pulp.plugins.yum_distributor.distributor:INFO: Publish complete: summary = <{'num_package_units_errors': 0, 'https_publish_dir': u'/var/lib/pulp/published/https/repos/ACME_Corporation/Library/custom/Bogus/vJfQQYnxXPpSWuY', 'num_package_categories_published': 0, 'num_distribution_units_errors': 0, 'skip_metadata_update': False, 'num_distribution_units_published': 0, 'num_package_groups_published': 0, 'num_package_units_attempted': 0, 'num_package_units_published': 0, 'num_distribution_units_attempted': 0, 'relative_path': u'ACME_Corporation/Library/custom/Bogus/vJfQQYnxXPpSWuY'}>, details = <{'errors': [], 'time_metadata_sec': 1.6432721614837646}> > /var/log/foreman-proxy/proxy.log <
I, [2014-04-01T14:17:07.318807 #29692] INFO -- : Initializing from Puppet config file: /etc/puppet/puppet.conf
I, [2014-04-01T14:17:07.451846 #29692] INFO -- : Initializing from Puppet config file: /etc/puppet/puppet.conf
I, [2014-04-01T14:17:07.479035 #29692] INFO -- : Initializing from Puppet config file: /etc/puppet/puppet.conf
I, [2014-04-01T14:17:07.536477 #29692] INFO -- : Initializing from Puppet config file: /etc/puppet/puppet.conf
I, [2014-04-01T14:17:07.632256 #29692] INFO -- : Initializing from Puppet config file: /etc/puppet/puppet.conf
I, [2014-04-01T14:17:07.691696 #29692] INFO -- : Initializing from Puppet config file: /etc/puppet/puppet.conf
I, [2014-04-01T14:17:07.713197 #29692] INFO -- : Initializing from Puppet config file: /etc/puppet/puppet.conf > /var/log/foreman/production.log <
Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/repositories/show.json.rabl within katello/api/v2/layouts/resource (114.5ms)
Completed 200 OK in 6168ms (Views: 112.3ms | ActiveRecord: 92.2ms)
Processing by Apipie::ApipiesController#apipie_checksum as JSON
Parameters: {"apipy"=>{}}
Rendered /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.1.2/app/views/apipie/apipies/apipie_checksum.json.erb (0.1ms)
Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)
Processing by Apipie::ApipiesController#apipie_checksum as JSON
Parameters: {"apipy"=>{}}
Rendered /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.1.2/app/views/apipie/apipies/apipie_checksum.json.erb (0.1ms)
Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::V2::RepositoriesController#show as application/json;version=2
Parameters: {"api_version"=>"v2", "id"=>"95", "repository"=>{}}
Expire fragment views/tabs_and_title_records-1 (0.1ms)
Authorized user admin(Admin User)
Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/repositories/show.json.rabl within katello/api/v2/layouts/resource (108.5ms)
Completed 200 OK in 186ms (Views: 107.2ms | ActiveRecord: 31.7ms)

Associated revisions

Revision 4121731b (diff)
Added by Partha Aji about 5 years ago

Fixes #6023 - Fixed code to associate gpg key to a product

The gpg key find method was botched in the lookup. Fixed it with a where clause and an org check

Revision 352cbdbb
Added by Partha Aji about 5 years ago

Merge pull request #4199 from parthaa/repo-gpg-fix

Fixes #6023 - Fixed code to associate gpg key to a product

History

#1 Updated by Eric Helms about 5 years ago

  • Target version set to 45
  • Triaged set to Yes

#2 Updated by Partha Aji about 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset katello|commit:4121731bf7313e874aa00e5a322c22a2fe1a5af5.

#3 Updated by Eric Helms almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 13

Also available in: Atom PDF