)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"9df2374c0277a8da16415ee064556bb69ff56d8a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Brad Pokorny \u003cbpokorny@us.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-10-31 21:46:44 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Throw an error when a non-existing tenant is added to a user"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently, if a user is created without a tenantId, adding a"},{"line_number":10,"context_line":"non-existing tenantId to that user succeeds.  This change"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F%2FUog%3D","line":7,"updated":"2013-11-10 23:39:12.000000000","message":"change \"Throw\" to \"Return\"","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"},{"author":{"_account_id":7179,"name":"Brad Pokorny","email":"brad_pokorny@symantec.com","username":"bpokorny"},"change_message_id":"c2ae25bdf138ffed42db783217c981f357a7c4f9","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Brad Pokorny \u003cbpokorny@us.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-10-31 21:46:44 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Throw an error when a non-existing tenant is added to a user"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently, if a user is created without a tenantId, adding a"},{"line_number":10,"context_line":"non-existing tenantId to that user succeeds.  This change"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F%2FR9I%3D","line":7,"in_reply_to":"AAAATn%2F%2FUog%3D","updated":"2013-11-11 19:29:37.000000000","message":"Done","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"9df2374c0277a8da16415ee064556bb69ff56d8a","unresolved":false,"context_lines":[{"line_number":11,"context_line":"checks for whether the tenant exists in cases where the check"},{"line_number":12,"context_line":"was previously skipped."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Fixes bug 1246473"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I2a814c5df902a97297ad05950ae4205664ddf6e6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F%2FUoM%3D","line":14,"updated":"2013-11-10 23:39:12.000000000","message":"Use\n\n Closes-Bug: #1246473\n\nSee https://wiki.openstack.org/wiki/GitCommitMessages#Including_external_references","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"},{"author":{"_account_id":7179,"name":"Brad Pokorny","email":"brad_pokorny@symantec.com","username":"bpokorny"},"change_message_id":"c2ae25bdf138ffed42db783217c981f357a7c4f9","unresolved":false,"context_lines":[{"line_number":11,"context_line":"checks for whether the tenant exists in cases where the check"},{"line_number":12,"context_line":"was previously skipped."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Fixes bug 1246473"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I2a814c5df902a97297ad05950ae4205664ddf6e6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F%2FR9E%3D","line":14,"in_reply_to":"AAAATn%2F%2FUoM%3D","updated":"2013-11-11 19:29:37.000000000","message":"Done","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"}],"keystone/identity/controllers.py":[{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"e058064f67768443509301cf27258fecd3d308e5","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        if default_project_id is not None:"},{"line_number":231,"context_line":"            user[\u0027default_project_id\u0027] \u003d default_project_id"},{"line_number":232,"context_line":"            # Make sure the new project actually exists before moving on"},{"line_number":233,"context_line":"            self.assignment_api.get_project(default_project_id)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        old_user_ref \u003d self.identity_api.v3_to_v2_user("},{"line_number":236,"context_line":"            self.identity_api.get_user(user_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FpDA%3D","line":233,"updated":"2013-10-31 01:15:38.000000000","message":"This will cause all updates to a user to fail if the default_project has been removed. even if a user isn\u0027t changing the default project id.  do we really want to force a default_project_id update if the project no longer exists?  If the project doesn\u0027t exist (or the user has no access to the project) the token should be unscoped.  This is likely the wrong change.\n\nThe correct solution probably is to add an elif case at line 241 that looks like (or make the already complex if-statement on line 235 handle this case):\n\nelif (\u0027tenantId\u0027 not in old_user_ref and default_project_id is not None):\n    # Make sure the new project actually exists before we perform the \n    # user update\n    self.assignment_api.get_project(default_project_id)","commit_id":"e2ffd74e6b9d2b00aef90e953c3ff55c7442e3ef"},{"author":{"_account_id":7179,"name":"Brad Pokorny","email":"brad_pokorny@symantec.com","username":"bpokorny"},"change_message_id":"315534ea822896e1c343a1423dd85be5ce07336d","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        if default_project_id is not None:"},{"line_number":231,"context_line":"            user[\u0027default_project_id\u0027] \u003d default_project_id"},{"line_number":232,"context_line":"            # Make sure the new project actually exists before moving on"},{"line_number":233,"context_line":"            self.assignment_api.get_project(default_project_id)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        old_user_ref \u003d self.identity_api.v3_to_v2_user("},{"line_number":236,"context_line":"            self.identity_api.get_user(user_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FlfU%3D","line":233,"in_reply_to":"AAAATn%2F%2FpDA%3D","updated":"2013-10-31 20:58:12.000000000","message":"Done","commit_id":"e2ffd74e6b9d2b00aef90e953c3ff55c7442e3ef"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"9df2374c0277a8da16415ee064556bb69ff56d8a","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":241,"context_line":"            # user update."},{"line_number":242,"context_line":"            self.assignment_api.get_project(default_project_id)"},{"line_number":243,"context_line":"        elif (\u0027tenantId\u0027 not in old_user_ref and"},{"line_number":244,"context_line":"                default_project_id is not None):"},{"line_number":245,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":246,"context_line":"            # user update"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FUos%3D","line":243,"updated":"2013-11-10 23:39:12.000000000","message":"Combine the \"if\" and \"elif\" here so that don\u0027t have to duplicate the code at 242 \u0026 247.\n\ne.g., from 237:\n\n if ((\u0027tenantId\u0027 in old_user_ref and\n       old_user_ref[\u0027tenantId\u0027] !\u003d default_project_id and\n       default_project_id is not None) or\n     (\u0027tenantId\u0027 not in old_user_ref and\n      default_project_id is not None)):\n  self.assignment_api.get_project(default_project_id)\n\nAlso, add a comment to explain what situation this is handling.","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"},{"author":{"_account_id":8289,"name":"huangtianhua","email":"tiantian223@163.com","username":"huangtianhua"},"change_message_id":"ab98bacf6189eb74d6091eab0e323f55f49e53be","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":241,"context_line":"            # user update."},{"line_number":242,"context_line":"            self.assignment_api.get_project(default_project_id)"},{"line_number":243,"context_line":"        elif (\u0027tenantId\u0027 not in old_user_ref and"},{"line_number":244,"context_line":"                default_project_id is not None):"},{"line_number":245,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":246,"context_line":"            # user update"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FkuA%3D","line":243,"updated":"2013-11-01 04:00:30.000000000","message":"In my opinion the two conditions can combinated.As:\nif (default_project_id is not None and old_user_ref[\u0027tenantId\u0027] !\u003d default_project_id):","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"},{"author":{"_account_id":8289,"name":"huangtianhua","email":"tiantian223@163.com","username":"huangtianhua"},"change_message_id":"25a87320f589c03ad7d846e124cc876875874e55","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":241,"context_line":"            # user update."},{"line_number":242,"context_line":"            self.assignment_api.get_project(default_project_id)"},{"line_number":243,"context_line":"        elif (\u0027tenantId\u0027 not in old_user_ref and"},{"line_number":244,"context_line":"                default_project_id is not None):"},{"line_number":245,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":246,"context_line":"            # user update"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FkXY%3D","line":243,"updated":"2013-11-01 06:32:30.000000000","message":"Sorry.I made a mistake.","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"},{"author":{"_account_id":7179,"name":"Brad Pokorny","email":"brad_pokorny@symantec.com","username":"bpokorny"},"change_message_id":"c2ae25bdf138ffed42db783217c981f357a7c4f9","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":241,"context_line":"            # user update."},{"line_number":242,"context_line":"            self.assignment_api.get_project(default_project_id)"},{"line_number":243,"context_line":"        elif (\u0027tenantId\u0027 not in old_user_ref and"},{"line_number":244,"context_line":"                default_project_id is not None):"},{"line_number":245,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":246,"context_line":"            # user update"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FR88%3D","line":243,"in_reply_to":"AAAATn%2F%2FUfc%3D","updated":"2013-11-11 19:29:37.000000000","message":"Done","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"ce70f8edf2b8fc7601c513c08a0a141c91f7085d","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":241,"context_line":"            # user update."},{"line_number":242,"context_line":"            self.assignment_api.get_project(default_project_id)"},{"line_number":243,"context_line":"        elif (\u0027tenantId\u0027 not in old_user_ref and"},{"line_number":244,"context_line":"                default_project_id is not None):"},{"line_number":245,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":246,"context_line":"            # user update"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FUfc%3D","line":243,"in_reply_to":"AAAATn%2F%2FUos%3D","updated":"2013-11-11 01:12:21.000000000","message":"This one one of the options i provided for a previous patchset.  The only downside to merging the if-statements is that it makes an ugly/almost unreadable if-statement worse.  It does remove a minor amount of duplicated code.\n\nThis is a fair request to make.","commit_id":"03a762586ef39fa9245b9a452e969179c2771690"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"bdd03107278a6c41e98f947c779fc4ac89573e70","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                old_user_ref[\u0027tenantId\u0027] !\u003d default_project_id and"},{"line_number":243,"context_line":"                default_project_id is not None) or"},{"line_number":244,"context_line":"            (\u0027tenantId\u0027 not in old_user_ref and"},{"line_number":245,"context_line":"                default_project_id is not None)):"},{"line_number":246,"context_line":"            # Make sure the new project actually exists before we perform the"},{"line_number":247,"context_line":"            # user update."},{"line_number":248,"context_line":"            self.assignment_api.get_project(default_project_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FD28%3D","line":245,"updated":"2013-11-15 00:54:33.000000000","message":"could clean up with a function:\n\n  def default_project_changed():\n    if default_project_id is None:\n      # No new default project\n      return False\n\n    # There is a new default project\n\n    if \u0027tenantId\u0027 not in old_user_ref:\n      # default project is being added.\n      return True\n\n    # User had a default project, check if it changed.\n    return old_user_ref[\u0027tenantId\u0027] !\u003d default_project_id:\n\n  if default_project_changed():\n    self.assignment_api.get_project(default_project_id)","commit_id":"50d52538cf6128e4588bcce745dccb32a545e313"}]}
