Bug 623900 - Pulp-admin consumer delete does not delete consumer
Pulp-admin consumer delete does not delete consumer
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Jason Connor
: Triaged
Depends On:
Blocks: pulp-verified
  Show dependency treegraph
 
Reported: 2010-08-13 01:27 EDT by Shveta
Modified: 2014-03-30 21:38 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-08-16 10:03:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Shveta 2010-08-13 01:27:17 EDT
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 01:28:50 EDT
[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 10:54:41 EDT
$ 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 00:43:41 EDT
[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 11:18:39 EDT
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 11:42:39 EDT
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 12:49:55 EDT
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 12:58:34 EDT
Fixed in 0.77.
Comment 8 Jay Dobies 2010-11-03 15:35:38 EDT
Fixed in build 0.78.
Comment 9 Preethi Thomas 2010-11-05 13:51:00 EDT
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 10:03:06 EDT
Closing with Community Release 15

pulp-0.0.223-4.

Note You need to log in before you can comment on or make changes to this bug.