Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 745560

Summary: [RFE] add ability to add a user to admin group from beaker-init command line
Product: [Retired] Beaker Reporter: Bill Peck <bpeck>
Component: command lineAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.7CC: asaha, bpeck, dcallagh, dowang, mcsontos, stl, tools-bugs
Target Milestone: 19.1Keywords: EasyFix, FutureFeature, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: Misc
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-17 08:40:23 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 Bill Peck 2011-10-12 17:31:07 UTC
Description of problem:

Currently beaker-init will only add a new user to the admin group.  It should handle already existing users by simply looking them up and adding them to the group.

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

Comment 1 Nick Coghlan 2012-10-17 04:37:10 UTC
Bulk reassignment of issues as Bill has moved to another team.

Comment 3 Dan Callaghan 2014-11-24 01:46:30 UTC
http://gerrit.beaker-project.org/3506

Steps to reproduce:
1. Find an existing user account which is not in the admin group, or take an existing admin account and remove it from the admin group
2. On the server, run: beaker-init --user <username>

Expected results:
The existing user is added to the admin group.

Comment 6 Dan Callaghan 2014-11-28 04:57:57 UTC
Okay, I actually tested all the various cases properly this time:

http://gerrit.beaker-project.org/3522

Possible combinations are:

* db is empty, --user option is not passed
  -> error reported to the user and no action is taken

* db is empty, --user does not exist
  -> db is populated, user is created and added to admin group

* db schema is out of date, --user option is not passed
  -> db schema is upgraded

* db schema is out of date, --user does not exist
  -> db schema is upgraded, user is created and added to admin group

* db schema is out of date, --user is an existing user
  -> db schema is upgraded, existing user is added to admin group

* db schema is up to date, --user option is not passed
  -> command does nothing

* db schema is up to date, --user does not exist
  -> user is created and added to admin group

* db schema is up to date, --user is an existing user
  -> existing user is added to admin group

Comment 7 Dan Callaghan 2014-12-02 04:34:06 UTC
Matt pointed out there is one more case I hadn't considered.

* db schema is up to date, --user is an existing user and is already in the admin group
  -> command does nothing

I will update my patch to handle that properly.

Comment 10 Dan Callaghan 2014-12-17 08:40:23 UTC
Beaker 19.1 is released.