mysql root enable reports the user as 'root' instead of context.user
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack DBaaS (Trove) |
Fix Released
|
Low
|
Zhao Chao |
Bug Description
I noticed some odd entries in the root history table when working on the pxc root enable call. Where some entries said it was 'root' that enabled root on the instance. This should be the id of the user that called the api to enable root.
Here is a list that i saw in the table.
mysql> select * from root_enabled_
+------
| id | user | created |
+------
| 2e9ef51a-
| 43578dab-
| 4d75fac2-
| 5e156f99-
| 7603ef71-
| 7c782a70-
| 81b07317-
| b4a84b61-
| bd03733f-
| bfe12a82-
| d1598059-
| d69c1465-
| d93d35b5-
| e45a7d36-
| e5492ed8-
+------
https:/
Looks like the user here is hard-coded to 'root'. This should instead be context.user.
Although i'm not sure if context has the user attribute available here maybe that is why this is hard-coded currently.
Changed in trove: | |
milestone: | mitaka-3 → mitaka-rc1 |
Changed in trove: | |
milestone: | mitaka-rc1 → next |
Changed in trove: | |
assignee: | Luke Browning (lukebrowning-y) → Zhao Chao (zhaochao1984) |
status: | New → In Progress |
I think it is related: https:/ /bugs.launchpad .net/trove/ +bug/1532583
I had an idea we would be getting it from the models. The root user models define it already.
We just need a base method 'get_root_user' implemented by derived classes, which would return the appropriate model user.