Bug 727311

Summary: pulp.repo doesn't get cleaned up correctly if consumer gets deleted first
Product: [Retired] Pulp Reporter: dgao
Component: user-experienceAssignee: James Slagle <jslagle>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: skarmark
Target Milestone: ---Keywords: Triaged
Target Release: Sprint 29   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-24 20:15:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description dgao 2011-08-01 19:25:18 UTC
[root@pulp-nightly httpd]# pulp-admin auth login -u admin -p admin
User credentials successfully stored at [/root/.pulp/user-cert.pem]

[root@pulp-nightly httpd]# pulp-admin repo create --id=foo
poulSuccessfully created repository [ foo ]

[root@pulp-nightly httpd]# pulp-client -u admin -p admin consumer create --id=fred
pulSuccessfully created consumer [ fred ]

[root@pulp-nightly httpd]# pulp-client consumer bind --repoid=foo
Successfully subscribed consumer [fred] to repo [foo]
[root@pulp-nightly httpd]# yum repolist
Loaded plugins: pulp-profile-update
foo                                                                                                                                                                           | 2.6 kB     00:00     
foo/primary_db                                                                                                                                                                | 1.2 kB     00:00     
repo id                                                                    repo name                                                                                                           status
fedora                                                                     Fedora 14 - x86_64                                                                                                  22,161
fedora-pulp-testing                                                        Pulp is a python application for managing software content.                                                             13
foo                                                                        foo                                                                                                                      0
updates                                                                    Fedora 14 - x86_64 - Updates                                                                                         9,117
repolist: 31,291
[root@pulp-nightly httpd]# cat /etc/yum.repos.d/pulp.repo 
#
# Pulp Repositories
# Managed by Pulp client
#
[foo]
name = foo
enabled = 1
sslverify = 0
gpgcheck = 0
baseurl = https://pulp-nightly.usersys.redhat.com/pulp/repos/foo[root@pulp-nightly httpd]# 
[root@pulp-nightly httpd]# pulp-admin consumer delete --id=fred
Successfully deleted consumer [fred]

[root@pulp-nightly httpd]# pulp-admin repo delete --id=foo
Successful deleted repository [ foo ]

[root@pulp-nightly httpd]# cat /etc/yum.repos.d/pulp.repo 
#
# Pulp Repositories
# Managed by Pulp client
#

[foo]
name = foo
enabled = 1
sslverify = 0
gpgcheck = 0
baseurl = https://pulp-nightly.usersys.redhat.com/pulp/repos/foo[root@pulp-nightly httpd]# 

All subsequent yum related command will fail because yum will be unable to locate the repomd.xml of the deleted repo.

Comment 1 James Slagle 2011-10-20 14:59:19 UTC
commit e976a03b79e1ec5256d9a57449416639c9680440
Author: James Slagle <jslagle>
Date:   Thu Oct 20 10:58:05 2011 -0400

    727311 Unbind a consumer from all its repos before deleting it.


We now unbind a consumer from all its repos before we delete it.

Comment 2 Jeff Ortel 2011-10-21 22:30:32 UTC
build: 0.241

Comment 3 Preethi Thomas 2011-10-26 19:44:40 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.241-1.fc15.noarch

[root@preethi ~]#  pulp-admin auth login -u admin -p admin
User credentials successfully stored at [/root/.pulp/user-cert.pem]

[root@preethi ~]# pulp-admin repo create --id=foo
Successfully created repository [ foo ]
[root@preethi ~]#  pulp-consumer -u admin -p admin consumer register --id=test
warning: this client is not known to the pulp server; run 'pulp-consumer consumer register' to register it
Successfully registered consumer [ test ]

[root@preethi ~]#  pulp-consumer -u admin -p admin consumer bind --repoid=foo
Successfully subscribed consumer [test] to repo [foo]

[root@preethi ~]# yum repolist
Loaded plugins: auto-update-debuginfo, langpacks, presto, pulp-profile-update,
              : refresh-packagekit
Repository fedora-pulp is listed more than once in the configuration
beaker                                                   |  951 B     00:00     
epel-389-ds-base                                         | 1.3 kB     00:00     
fedora-debuginfo/metalink                                |  18 kB     00:00     
foo                                                      | 2.9 kB     00:00     
foo/primary_db                                           | 1.1 kB     00:00     
testing-fedora-pulp                                      | 2.9 kB     00:00     
updates/metalink                                         |  17 kB     00:00     
updates                                                  | 4.7 kB     00:00     
updates/primary_db                                       | 5.4 MB     00:00     
updates-debuginfo/metalink                               |  15 kB     00:00     
updates-debuginfo                                        | 3.1 kB     00:00     
updates-debuginfo/primary_db                             | 435 kB     00:00     
repo id                     repo name                                     status
beaker                      Beaker                                             1
epel-389-ds-base            389-ds-base package for EL6                       16
fedora                      Fedora 15 - x86_64                            24,085
fedora-debuginfo            Fedora 15 - x86_64 - Debug                     5,526
foo                         foo                                                0
testing-fedora-pulp         Pulp Testing Builds                               17
updates                     Fedora 15 - x86_64 - Updates                   7,358
updates-debuginfo           Fedora 15 - x86_64 - Updates - Debug           1,365
repolist: 38,368
[root@preethi ~]# cat /etc/yum.repos.d/pulp.repo 
#
# Pulp Repositories
# Managed by Pulp client
#

[foo]
name = foo
enabled = 1
sslverify = 0
gpgcheck = 0
baseurl = https://preethi.usersys.redhat.com/pulp/repos/foo[root@preethi ~]# 
[root@preethi ~]# 

[root@preethi ~]#  pulp-consumer -u admin -p admin consumer unregister 
Successfully unregistered consumer [test]

[root@preethi ~]# cat /etc/yum.repos.d/pulp.repo cat: /etc/yum.repos.d/pulp.repo: No such file or directory
[root@preethi ~]#

Comment 4 Preethi Thomas 2012-02-24 20:15:42 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 5 Preethi Thomas 2012-02-24 20:17:17 UTC
Pulp v1.0 is released.