Bug 623900

Summary: Pulp-admin consumer delete does not delete consumer
Product: [Retired] Pulp Reporter: Shveta <ssachdev>
Component: z_otherAssignee: Jason Connor <jconnor>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: jason.dobies, jconnor, mmccune, pkilambi, pthomas
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 14:03:06 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:    
Bug Blocks: 641987    

Description Shveta 2010-08-13 05:27:17 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

[root@shveta ~]# pulp-admin -u admin -p admin consumer delete --id=10.65.193.75
 Successfully deleted consumer [10.65.193.75]
[root@shveta ~]# pulp-admin -u admin -p admin consumer list
+-------------------------------------------+
    Consumer Information 
+-------------------------------------------+

Id                      10.65.193.26             
Description             10.65.193.26             
Subscribed Repos        /consumers/10.65.193.26/repoids/
Profile                 http://localhost:8811/consumers/10.65.193.26/package_profile/


Id                      abc                      
Description             abc                      
Subscribed Repos        /consumers/abc/repoids/  
Profile                 http://localhost:8811/consumers/abc/package_profile/


Id                      10.65.193.9              
Description             10.65.193.9              
Subscribed Repos        /consumers/10.65.193.9/repoids/
Profile                 http://localhost:8811/consumers/10.65.193.9/package_profile/


Id                      10.65.193.89             
Description             10.65.193.89             
Subscribed Repos        /consumers/10.65.193.89/repoids/
Profile                 http://localhost:8811/consumers/10.65.193.89/package_profile/


Id                      10.65.201.231            
Description             10.65.201.231            
Subscribed Repos        /consumers/10.65.201.231/repoids/
Profile                 http://localhost:8811/consumers/10.65.201.231/package_profile/


Id                      10.65.193.75             
Description             10.65.193.75             
Subscribed Repos        /consumers/10.65.193.75/repoids/
Profile                 http://localhost:8811/consumers/10.65.193.75/package_profile/

Comment 1 Shveta 2010-08-13 05:28:50 UTC
[root@shveta ~]# pulp-admin -u admin -p admin consumer delete --id=10.65.193.75
 Successfully deleted consumer [10.65.193.75]


I should be able to delete an un-existing consumer id . 
So delete an un-existing consumer id should say : consumer id doesn't exist .

Comment 2 Pradeep Kilambi 2010-08-17 14:54:41 UTC
$ sudo pulp-admin consumer delete --id=demo-consumer -u admin -p admin
 Successfully deleted consumer [demo-consumer]
$ sudo pulp-admin consumer delete --id=demo-consumer -u admin -p admin
 Deleted operation failed on Consumer [ demo-consumer ] 

seems to be working... please re-test

Comment 3 Shveta 2010-08-18 04:43:41 UTC
[root@fedora12g2 ~]# pulp-client -u admin -p admin consumer create --id=10.65.193.75
 Successfully created Consumer [ 10.65.193.75 ]
[root@fedora12g2 ~]# pulp-admin -u admin -p admin consumer delete --id=10.65.193.75
 Successfully deleted consumer [10.65.193.75]
[root@fedora12g2 ~]# pulp-admin -u admin -p admin consumer delete --id=10.65.193.75
 Successfully deleted consumer [10.65.193.75]
[root@fedora12g2 ~]# pulp-admin consumer delete --id=10.65.193.75 -u admin -p admin
 Successfully deleted consumer [10.65.193.75]
[root@fedora12g2 ~]# pulp-admin -u admin -p admin consumer list
+-------------------------------------------+
    Consumer Information 
+-------------------------------------------+

Id                      10.65.201.137            
Description             10.65.201.137            
Subscribed Repos        /consumers/10.65.201.137/repoids/
Profile                 http://localhost:8811/consumers/10.65.201.137/package_profile/


Id                      10.65.193.75             
Description             10.65.193.75             
Subscribed Repos        /consumers/10.65.193.75/repoids/
Profile                 http://localhost:8811/consumers/10.65.193.75/package_profile/

[root@fedora12g2 ~]# rpm -q pulp
pulp-0.0.50-1.git.7.ecb6917.fc12.noarch

Comment 4 Jay Dobies 2010-09-16 15:18:39 UTC
commit	732fc1c75d7536c387c98a76488e235a3d5d9391
tree	917e6784b17231df8977916a80a65866afd26401

623900 - Fixed consumer delete call to pymongo to use the correct parameter

src/pulp/server/api/consumer.py
test/unit/test_api.py

Comment 5 Preethi Thomas 2010-10-13 15:42:39 UTC
reopening

Looks like this is not working as expected.

Here is the scenario that I tried.

I have a pulp-server on one system and pulp-client on another

1. Created consumer on the client
2. deleted /etc/pulp/consumer on the client
3. Ran pulp-admin consumer delete
4. Now tried to create the consumer again on the client

gets the following 

[root@localhost ~]# pulp-client -u admin -p admin consumer create --id=10.16.120.215
warning: this client is currently not registered; please register to continue
error: operation failed: "Consumer with id: 10.16.120.215, already exists"

Comment 6 Jason Connor 2010-10-28 16:49:55 UTC
I just re-ran this test with the exact steps listed above and was able to successfully re-create the delete consumer. I think this may have gotten fixed accidentally in the cli refactor, I'm changing to modified.

Comment 7 Jay Dobies 2010-10-29 16:58:34 UTC
Fixed in 0.77.

Comment 8 Jay Dobies 2010-11-03 19:35:38 UTC
Fixed in build 0.78.

Comment 9 Preethi Thomas 2010-11-05 17:51:00 UTC
verified

[root@10 ~]# cd /etc/pulp/
client.conf  consumer     pulp.conf    
[root@10 ~]# cd /etc/pulp/consumer 
-bash: cd: /etc/pulp/consumer: Not a directory
[root@10 ~]# rm -rf /etc/pulp/consumer 
[root@10 ~]# 
[root@10 ~]# 
[root@10 ~]# 

[root@preethi ~]# pulp-admin consumer delete --id=10.16.79.206
Successfully deleted consumer [10.16.79.206]

[root@10 ~]# pulp-client -u admin -p admin consumer create --id=10.16.79.206
warning: this client is not registered; please register to continue
Successfully created consumer [ 10.16.79.206 ]

Comment 10 Preethi Thomas 2011-08-16 14:03:06 UTC
Closing with Community Release 15

pulp-0.0.223-4.