Bug 623578

Summary: pulp user: able to create duplicate usernames w/ unique --name
Product: [Retired] Pulp Reporter: wes hayutin <whayutin>
Component: z_otherAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED DUPLICATE QA Contact: wes hayutin <whayutin>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: cperry, pkilambi, pthomas, skarmark
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-17 14:48:41 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:

Description wes hayutin 2010-08-12 08:34:00 UTC
[root@localhost tmp]# pulp -u test01 -p dog8code user list
+-------------------------------------------+
             Available Users                 
+-------------------------------------------+

Login :               	admin                        
Name  :                	None                     


Login :               	westest01                    
Name  :                	None                     


Login :               	westest01                    
Name  :                	None                     


Login :               	westest02                    
Name  :                	None                     

[root@localhost tmp]# pulp -u test01 -p dog8code user create --newusername=westest01 --newpassword=dog8code --name=westest01
"Traceback (most recent call last):\n  File \"/usr/lib/python2.6/site-

<snip>

self.__check_response_to_last_error(response)\n  File \"/usr/lib/python2.6/site-packages/pymongo/connection.py\", line 540, in __check_response_to_last_error\n    raise DuplicateKeyError(error[\"err\"])\nDuplicateKeyError: E11000 duplicate key error index: _database.users.$_id_  dup key: { : \"westest01\" }\n"


[root@localhost tmp]# pulp -u test01 -p dog8code user create --newusername=westest01 --newpassword=dog8code --name=westest04
 Successfully created User [ westest01 ] with name [ None ]
[root@localhost tmp]# 


Expected Results:

I would think that usernames should also have to be unique, not just names.
Not sure if its a bug or by design, opening to verify.

Comment 1 wes hayutin 2010-08-12 08:36:19 UTC
yup, I think its a bug. Running the delete command for username=westest01 will delete ALL the entries in the list.  It should be unique.


[root@localhost tmp]# pulp -u test01 -p dog8code user delete --deleteusername=westest01
 Successfully deleted User [ westest01 ] 
[root@localhost tmp]# pulp -u test01 -p dog8code user list
+-------------------------------------------+
             Available Users                 
+-------------------------------------------+

Login :               	admin                        
Name  :                	None                     


Login :               	westest02                    
Name  :                	None

Comment 2 Pradeep Kilambi 2010-08-17 14:48:41 UTC

*** This bug has been marked as a duplicate of bug 620893 ***