trove client create call with optional user and database(s) args does not grant user access

Bug #1246023 reported by Dan Nguyen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-troveclient
Fix Released
Medium
Sushil Kumar

Bug Description

When you supply the optional command line args for user and databases during instance create the trove api does not grant the user privileges to the database.

$ trove --debug create dntest4 1001 --users dntest:dnpass --databases my database

+----------+--------------------------------------+
| Property | Value |
+----------+--------------------------------------+
| flavor | 1001 |
| id | 18961e76-8042-44d0-812f-74173ca7fedd |
| name | dntest4 |
| status | ACTIVE |
+----------+--------------------------------------+

$ trove database-list 18961e76-8042-44d0-812f-74173ca7fedd
+------------+
| name |
+------------+
| mydatabase |
+------------+

$ trove user-list 18961e76-8042-44d0-812f-74173ca7fedd
+--------+------+-----------+
| name | host | databases |
+--------+------+-----------+
| dntest | % | [] |
+--------+------+-----------+

mysql shows that there is only usage privileges for the new user.

Grants for dntest@%
GRANT USAGE ON *.* TO 'dntest'@'%' IDENTIFIED BY PASSWORD '*ED4215FA147DEDF8507B0C28E7AC8F6CFABBE881'

* To correct this you can use the user-grant-access api call.

$ trove user-grant-access 18961e76-8042-44d0-812f-74173ca7fedd detest mydatabase

$ trove user-list 18961e76-8042-44d0-812f-74173ca7fedd
+--------+------+----------------------------+
| name | host | databases |
+--------+------+----------------------------+
| dntest | % | [{u'name': u'mydatabase'}] |
+--------+------+----------------------------+

The proposed fix would be to make this additional call through the trove client.

Changed in python-troveclient:
assignee: nobody → Dan Nguyen (daniel-a-nguyen)
Revision history for this message
Dan Nguyen (daniel-a-nguyen) wrote :

After looking at the code I'm considering making the this fix in the trove api itself.

Revision history for this message
Dan Nguyen (daniel-a-nguyen) wrote :

We have work arounds so we'll keep this bug in the background for now.

Revision history for this message
Dan Nguyen (daniel-a-nguyen) wrote :

A fix for this requires a bit more discussion. It would probably involve client and server side changes.
The bit that might need to be figured out is how we would want to form the POST body from the python-troveclient to associate users to databases.

It could get messy if say you have more that one user specified and more than one database and only wanted some users to use database 'a' and others to only use database 'b'.

It might be worth considering removing the --user --database(s) optional args from the python trove client.

Changed in python-troveclient:
assignee: Dan Nguyen (daniel-a-nguyen) → nobody
Revision history for this message
Sushil Kumar (sushil-kumar2) wrote :

I think this got resoved with another new one reported

https://bugs.launchpad.net/trove/+bug/1272421

Revision history for this message
Sushil Kumar (sushil-kumar2) wrote :
Revision history for this message
Sushil Kumar (sushil-kumar2) wrote :

Updating it as fix committed as problem does not stands any more and got fixed through another bug reported(with duplication missed).

Changed in python-troveclient:
assignee: nobody → Sushil Kumar (sushil-kumar2)
status: New → Fix Committed
Changed in python-troveclient:
status: Fix Committed → Fix Released
importance: Undecided → Medium
milestone: none → python-troveclient-v1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.