)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"6344954a7deb466cafc9f2ccb46b7ae1795e81d7","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In sqlalchemy 1.2.x version, Boolean datatype enforces strict"},{"line_number":10,"context_line":"True/False/None values. When create nonlocal user, it set"},{"line_number":11,"context_line":"enabled u\u0027544\u0027 before the fix, then creation failed. In this fix,"},{"line_number":12,"context_line":"change enabled to True to work with sqlalchemy 1.2.x version."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I076e2c34d24469ff68abfd107b45f5fc63306409"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fb8cfa7_f33980f1","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":14},"updated":"2019-06-12 17:08:36.000000000","message":"Are you using the user_enabled_mask option? This setting should not be 544 when it gets to the shadow backend, it should already have been converted to a boolean by the ldap driver.","commit_id":"2a350e743660ea7a9f2fb5aa84cc417d8c624b49"}],"keystone/identity/shadow_backends/sql.py":[{"author":{"_account_id":16465,"name":"Kristi Nikolla","email":"knikolla@bu.edu","username":"knikolla"},"change_message_id":"7e6061fd5b9bb6d38503844659dc502b7fef4089","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        new_user_dict.pop(\u0027name\u0027, None)"},{"line_number":156,"context_line":"        new_user_dict.pop(\u0027password\u0027, None)"},{"line_number":157,"context_line":"        # set enabled a strict bool value"},{"line_number":158,"context_line":"        new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":159,"context_line":"        # create nonlocal_user dict"},{"line_number":160,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":161,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_f8f1966c","line":158,"updated":"2019-05-24 16:39:25.000000000","message":"You cannot just assume that this will always be true. For LDAP specifically, there is a whole series of configuration options about how to figure out if a user should be enabled or not. https://github.com/openstack/keystone/blob/d2b5550214cecd8a753253066d61e3419e76e952/keystone/conf/ldap.py#L159-L202","commit_id":"2a83ab8ba219d41523fb589b85af2b920cb37176"},{"author":{"_account_id":16264,"name":"zhenmei","email":"zma@vmware.com","username":"zma"},"change_message_id":"0ce431b18439b2e9a82e6f62abd0d3016bc23425","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        new_user_dict.pop(\u0027name\u0027, None)"},{"line_number":156,"context_line":"        new_user_dict.pop(\u0027password\u0027, None)"},{"line_number":157,"context_line":"        # set enabled a strict bool value"},{"line_number":158,"context_line":"        new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":159,"context_line":"        # create nonlocal_user dict"},{"line_number":160,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":161,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfb3d3c7_c3a92c7c","line":158,"in_reply_to":"bfb3d3c7_f8f1966c","updated":"2019-05-28 02:15:07.000000000","message":"Hi Kristi,\n\nThanks for your comments! submit the new patch for it. Since the enabled value has been processed by functionality _ldap_res_to_model, if it still in integer format, I think it is true. I think it also keep consistent with using sqlalchemy 1.1.x which take integer as bool True.","commit_id":"2a83ab8ba219d41523fb589b85af2b920cb37176"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"3792e27c01673ffe1d0e507ce9e6bf63865b260f","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        # set enabled a strict bool value if it\u0027s value is integer"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            int(new_user_dict[\u0027enabled\u0027])"},{"line_number":160,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":161,"context_line":"        except ValueError:"},{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":"        # create nonlocal_user dict"}],"source_content_type":"text/x-python","patch_set":3,"id":"bfb3d3c7_1b21c49f","line":160,"range":{"start_line":160,"start_character":36,"end_line":160,"end_character":43},"updated":"2019-05-29 18:31:00.000000000","message":"This still misses Kristi\u0027s point about assuming whether the user is enabled or not. It cannot be hardcoded to True, it needs to read the existing value and convert it appropriately.","commit_id":"fe69f8acfca3fa8f9c0f8b76d6889e4d7a985b8e"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"3792e27c01673ffe1d0e507ce9e6bf63865b260f","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            int(new_user_dict[\u0027enabled\u0027])"},{"line_number":160,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":161,"context_line":"        except ValueError:"},{"line_number":162,"context_line":"            pass"},{"line_number":163,"context_line":"        # create nonlocal_user dict"},{"line_number":164,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":165,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bfb3d3c7_fb3e30b6","line":162,"range":{"start_line":161,"start_character":8,"end_line":162,"end_character":16},"updated":"2019-05-29 18:31:00.000000000","message":"This is not a good use of try/except. This should use if/else logic to check the value and set it conditionally, not use this goto-style jumping logic.","commit_id":"fe69f8acfca3fa8f9c0f8b76d6889e4d7a985b8e"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"6344954a7deb466cafc9f2ccb46b7ae1795e81d7","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        new_user_dict.pop(\u0027password\u0027, None)"},{"line_number":157,"context_line":"        # set enabled a strict bool value if it\u0027s value is integer"},{"line_number":158,"context_line":"        if str(new_user_dict[\u0027enabled\u0027]).isdigit():"},{"line_number":159,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":160,"context_line":"        # create nonlocal_user dict"},{"line_number":161,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":162,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_9370440a","line":159,"range":{"start_line":159,"start_character":39,"end_line":159,"end_character":43},"updated":"2019-06-12 17:08:36.000000000","message":"This still needs to account for the case that new_user_dict[\u0027enabled\u0027] is 0, i.e., NOT enabled.","commit_id":"2a350e743660ea7a9f2fb5aa84cc417d8c624b49"},{"author":{"_account_id":16264,"name":"zhenmei","email":"zma@vmware.com","username":"zma"},"change_message_id":"025d85d5ed61e9653d8ef04816fa60246551e9f2","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        new_user_dict.pop(\u0027password\u0027, None)"},{"line_number":157,"context_line":"        # set enabled a strict bool value if it\u0027s value is integer"},{"line_number":158,"context_line":"        if str(new_user_dict[\u0027enabled\u0027]).isdigit():"},{"line_number":159,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":160,"context_line":"        # create nonlocal_user dict"},{"line_number":161,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":162,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_7eecf58e","line":159,"range":{"start_line":159,"start_character":39,"end_line":159,"end_character":43},"in_reply_to":"9fb8cfa7_32ed5b25","updated":"2019-06-20 02:30:49.000000000","message":"Thanks for your explanation! Will fix in next patch.","commit_id":"2a350e743660ea7a9f2fb5aa84cc417d8c624b49"},{"author":{"_account_id":16264,"name":"zhenmei","email":"zma@vmware.com","username":"zma"},"change_message_id":"b69577b5d76931d20413a2c1bbae4ccef105b9c3","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        new_user_dict.pop(\u0027password\u0027, None)"},{"line_number":157,"context_line":"        # set enabled a strict bool value if it\u0027s value is integer"},{"line_number":158,"context_line":"        if str(new_user_dict[\u0027enabled\u0027]).isdigit():"},{"line_number":159,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":160,"context_line":"        # create nonlocal_user dict"},{"line_number":161,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":162,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_bc4e7035","line":159,"range":{"start_line":159,"start_character":39,"end_line":159,"end_character":43},"in_reply_to":"9fb8cfa7_9370440a","updated":"2019-06-13 01:25:29.000000000","message":"Sorry, I still confused why 0 means not enabled. After ldap driver, this value should be real bool, like true or false. or integer if no  user_enabled_mask option used. Why integer 0 means disable?","commit_id":"2a350e743660ea7a9f2fb5aa84cc417d8c624b49"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"33210487819032ff868f6fa409bb5cc4e6e68eba","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        new_user_dict.pop(\u0027password\u0027, None)"},{"line_number":157,"context_line":"        # set enabled a strict bool value if it\u0027s value is integer"},{"line_number":158,"context_line":"        if str(new_user_dict[\u0027enabled\u0027]).isdigit():"},{"line_number":159,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":160,"context_line":"        # create nonlocal_user dict"},{"line_number":161,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":162,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_32ed5b25","line":159,"range":{"start_line":159,"start_character":39,"end_line":159,"end_character":43},"in_reply_to":"9fb8cfa7_bc4e7035","updated":"2019-06-19 16:43:57.000000000","message":"There are cases where the deployer can explicitly tell keystone to use an alternative form for determining if the user is enabled. It becomes a comparison against an int of 0 or 1 (0 being disabled) which is not a true python boolean even though it evaluates to \"False\" [in most cases]. Blindly setting to \"True\" if it is any digit is incorrect and may cause users to be \"enabled\" incorrectly.","commit_id":"2a350e743660ea7a9f2fb5aa84cc417d8c624b49"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"2efeb8fd9c0b065e8cb9d60f616d3e74e25a4290","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d False"},{"line_number":160,"context_line":"        # set enabled a strict bool value if it\u0027s value is integer except 0"},{"line_number":161,"context_line":"        if str(new_user_dict[\u0027enabled\u0027]).isdigit():"},{"line_number":162,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":163,"context_line":"        # create nonlocal_user dict"},{"line_number":164,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":165,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_cfaf2328","line":162,"updated":"2019-06-25 15:22:56.000000000","message":"This would need to use else, otherwise str(0).isdigit() still evaluates to True and the enabled attribute is overwritten. You could also just cast the value directly with bool().","commit_id":"28457435b1a75dfc224d1ee9d3e077dd45689bb2"},{"author":{"_account_id":16264,"name":"zhenmei","email":"zma@vmware.com","username":"zma"},"change_message_id":"e8811f8b7b9b7cde97a7289287667abd0510963f","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d False"},{"line_number":160,"context_line":"        # set enabled a strict bool value if it\u0027s value is integer except 0"},{"line_number":161,"context_line":"        if str(new_user_dict[\u0027enabled\u0027]).isdigit():"},{"line_number":162,"context_line":"            new_user_dict[\u0027enabled\u0027] \u003d True"},{"line_number":163,"context_line":"        # create nonlocal_user dict"},{"line_number":164,"context_line":"        new_nonlocal_user_dict \u003d {"},{"line_number":165,"context_line":"            \u0027name\u0027: user_dict[\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_46079583","line":162,"in_reply_to":"9fb8cfa7_cfaf2328","updated":"2019-06-26 01:57:29.000000000","message":"Thanks for comments! In fact, if works here since 0 has been translated to False, so it would not an integer anymore. But it looks a little confuse here, I will update to else.","commit_id":"28457435b1a75dfc224d1ee9d3e077dd45689bb2"}]}
