)]}'
{"openstack_dashboard/dashboards/admin/users/forms.py":[{"author":{"_account_id":2170,"name":"Dave Lapsley","email":"david.lapsley@metacloud.com","username":"dlapsley"},"change_message_id":"133fe26a4b3d2096e3bd1ff2e9e66331e20a0944","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                                        new_user.id,"},{"line_number":130,"context_line":"                                        data[\u0027project\u0027])"},{"line_number":131,"context_line":"                create_role \u003d True"},{"line_number":132,"context_line":"                if roles is not None:"},{"line_number":133,"context_line":"                    for role in roles:"},{"line_number":134,"context_line":"                        if role.id \u003d\u003d str(data[\u0027role_id\u0027]):"},{"line_number":135,"context_line":"                            create_role \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_61ff5235","line":132,"updated":"2014-05-26 17:27:28.000000000","message":"Minor comment. From looking at keystone client code, it looks like the roles_for_user() call above will always return a list (sometimes empty). Currently, the loop test on the line below will catch the case when an empty list is returned, but it appears we want to catch it in the line above.\n\nThis could be accomplished using:\n\n\"if roles:\"\n\ninstead of\n\n\"if roles is not None:\"","commit_id":"8f848bb4371a10b1f096a14d9b567f9b9efef1f3"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"01a4d9c45db51666139c54d84ee480d00c5e2732","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                        if role.id \u003d\u003d str(data[\u0027role_id\u0027]):"},{"line_number":135,"context_line":"                            create_role \u003d False"},{"line_number":136,"context_line":"                            break"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"                if create_role is True:"},{"line_number":139,"context_line":"                    try:"},{"line_number":140,"context_line":"                        api.keystone.add_tenant_user_role(request,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_7e9532e3","line":137,"updated":"2014-05-26 15:32:05.000000000","message":"As shown in the bug description, Keystone raises Warning and a \u0027Conflict\u0027 error message. Can we determine here the type of the Exception, and track these kind of conflicts separately than other exceptions?","commit_id":"8f848bb4371a10b1f096a14d9b567f9b9efef1f3"},{"author":{"_account_id":10247,"name":"Santiago Baldassin","email":"santiago.b.baldassin@intel.com","username":"santibaldassin"},"change_message_id":"6704358874878e9a8b295cfec46670b29cf7c432","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                            create_role \u003d False"},{"line_number":136,"context_line":"                            break"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"                if create_role is True:"},{"line_number":139,"context_line":"                    try:"},{"line_number":140,"context_line":"                        api.keystone.add_tenant_user_role(request,"},{"line_number":141,"context_line":"                                                        data[\u0027project\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"7adec928_94953842","line":138,"updated":"2014-05-23 13:09:37.000000000","message":"\"If create_role:\" should be enough here","commit_id":"8f848bb4371a10b1f096a14d9b567f9b9efef1f3"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"01a4d9c45db51666139c54d84ee480d00c5e2732","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                            create_role \u003d False"},{"line_number":136,"context_line":"                            break"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"                if create_role is True:"},{"line_number":139,"context_line":"                    try:"},{"line_number":140,"context_line":"                        api.keystone.add_tenant_user_role(request,"},{"line_number":141,"context_line":"                                                        data[\u0027project\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_fe76a2d7","line":138,"updated":"2014-05-26 15:32:05.000000000","message":"With one-liner:\n\n    if roles and not any([role for role in roles if role.id \u003d\u003d str(data[\u0027role_id\u0027])]):","commit_id":"8f848bb4371a10b1f096a14d9b567f9b9efef1f3"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7714c816ee3ef02d2f7cacfa5930283bc041fd91","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                roles \u003d api.keystone.roles_for_user(request,"},{"line_number":129,"context_line":"                                        new_user.id,"},{"line_number":130,"context_line":"                                        data[\u0027project\u0027])"},{"line_number":131,"context_line":"                if roles and not any("},{"line_number":132,"context_line":"                        [role for role in roles if role.id \u003d\u003d str("},{"line_number":133,"context_line":"                            data[\u0027role_id\u0027])]):"},{"line_number":134,"context_line":"                    try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ae8d1ca_27c198e4","line":131,"updated":"2014-05-29 12:06:23.000000000","message":"If \u0027roles\u0027 is empty, add_tenant_user_role is not called. \nIf I understand correctly, it needs to be:\n\n  if not roles or not [role for role in roles if role.id \u003d\u003d str(data[\u0027role_id\u0027]):\n    try:\n       ...\n\nOr:\n\n   roles \u003d api.keystone.roles_for_user(...) or []\n   assigned \u003d [role for role in roles if role.id \u003d\u003d str(data[\u0027role_id\u0027])]\n   if not assigned:\n       try:\n           api.keystone.add_tenant_user_role(...)","commit_id":"41cd9084000f8f97d1426fbe41961b5e6cbf9fa0"}],"openstack_dashboard/dashboards/admin/users/tests.py":[{"author":{"_account_id":2170,"name":"Dave Lapsley","email":"david.lapsley@metacloud.com","username":"dlapsley"},"change_message_id":"133fe26a4b3d2096e3bd1ff2e9e66331e20a0944","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                                       \u0027tenant_list\u0027,"},{"line_number":78,"context_line":"                                       \u0027add_tenant_user_role\u0027,"},{"line_number":79,"context_line":"                                       \u0027get_default_role\u0027,"},{"line_number":80,"context_line":"                                       \u0027roles_for_user\u0027,"},{"line_number":81,"context_line":"                                       \u0027role_list\u0027)})"},{"line_number":82,"context_line":"    def test_create(self):"},{"line_number":83,"context_line":"        user \u003d self.users.get(id\u003d\"1\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_2141ca5a","line":80,"updated":"2014-05-26 17:27:28.000000000","message":"Do these tests cover the case when an empty role list is returned? If not, it might be a good idea to add a test case that covers this as well.","commit_id":"8f848bb4371a10b1f096a14d9b567f9b9efef1f3"}]}
