Bug 745560 - [RFE] add ability to add a user to admin group from beaker-init command line
Summary: [RFE] add ability to add a user to admin group from beaker-init command line
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 19.1
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard: Misc
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-12 17:31 UTC by Bill Peck
Modified: 2014-12-18 00:15 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-17 08:40:23 UTC
Embargoed:


Attachments (Terms of Use)

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.


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