Bug 638736
Summary: | pulp-admin user delete lets you delete the admin / last user | ||
---|---|---|---|
Product: | [Retired] Pulp | Reporter: | Preethi Thomas <pthomas> |
Component: | z_other | Assignee: | Jeff Ortel <jortel> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Preethi Thomas <pthomas> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | unspecified | CC: | jortel, mmccune |
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:01:45 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
Preethi Thomas
2010-09-29 19:19:32 UTC
scoped for sprint 16. Make sure its checking for atleast one user. also need to update the check we do upon httpd restart to instead of checking for the existence of the default user it checks to see that there is at least one: class UserApi(BaseApi): ... def _ensure_default_admin(self): admin = self.user(self.default_login) if (admin is None): default_password = config.config.get('server', 'default_password') self.create(self.default_login, password=default_password) update the above code to check for 1 admin vs the default. Fixed: 20146a734471d4e2a68f58106910c02359682707 When fixing this bug I assumed that the 'admin' user and auth stuff will change significantly with RBAC implementation. The default user should be created with the 'admin' role. The check when removing users should be in the API instead of WS and should ensure that at least (1) user with admin privileges exists at all times. Fixed in 0.77. Fixed in build 0.78. [root@preethi ~]# pulp-admin consumer list +------------------------------------------+ Consumer Information +------------------------------------------+ Id 10.16.79.206 Description None Subscribed Repos /pulp/api/consumers/10.16.79.206/repoids/ Profile https://preethi.usersys.redhat.com:443/pulp/api/consumers/10.16.79.206/package_profile/ Additional info {} Id preethi.usersys.redhat.com Description None Subscribed Repos /pulp/api/consumers/preethi.usersys.redhat.com/repoids/ Profile https://preethi.usersys.redhat.com:443/pulp/api/consumers/preethi.usersys.redhat.com/package_profile/ Additional info {u'county': u'wake', u'country': u'us', u'country1': u'us1', u'location': u'rdu'} [root@preethi ~]# pulp-admin user list +------------------------------------------+ Available Users +------------------------------------------+ Login : admin Name : None Login : pt-admin Name : You have new mail in /var/spool/mail/root [root@preethi ~]# pulp-admin user delete --help Usage: pulp-admin <options> user delete <options> Options: -h, --help show this help message and exit --username=USERNAME username of user you wish to delete (required) [root@preethi ~]# pulp-admin user delete --username=pt-admin Successfully deleted User [ pt-admin ] [root@preethi ~]# pulp-admin user delete --username=admin User [admin] not deleted [root@preethi ~]# pulp-admin user create --username=pt-admin Successfully created user [ pt-admin ] with name [ ] [root@preethi ~]# pulp-admin user delete --username=admin User [admin] not deleted [root@preethi ~]# pulp-admin user list +------------------------------------------+ Available Users +------------------------------------------+ Login : admin Name : None Login : pt-admin Name : [root@preethi ~]# pulp-admin user create --username=pt-admin error: operation failed: "A user with the login, pt-admin, already exists" [root@preethi ~]# pulp-admin user delete --username=pt-admin Successfully deleted User [ pt-admin ] [root@preethi ~]# pulp-admin user list +------------------------------------------+ Available Users +------------------------------------------+ Login : admin Name : None [root@preethi ~]# Closing with Community Release 15 pulp-0.0.223-4. |