)]}'
{"keystone/common/fernet_utils.py":[{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"ebb63464df3283c478e18302e701ea1a05e4df2f","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                \u0027%s\u0027) %"},{"line_number":135,"context_line":"                self.key_repository)"},{"line_number":136,"context_line":"        # Determine the file name of the new key"},{"line_number":137,"context_line":"        key_file \u003d os.path.join(self.key_repository, \u00270.tmp\u0027)"},{"line_number":138,"context_line":"        create_success \u003d False"},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            with open(key_file, \u0027w\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_55b8b7e5","line":137,"updated":"2016-12-23 07:51:53.000000000","message":"Why not write the temporary key in /tmp with a random filename. That way there\u0027s less chance of a file name collision.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"aca52a80035d9562c1b2bf92650c4a2b86a49d19","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                \u0027%s\u0027) %"},{"line_number":135,"context_line":"                self.key_repository)"},{"line_number":136,"context_line":"        # Determine the file name of the new key"},{"line_number":137,"context_line":"        key_file \u003d os.path.join(self.key_repository, \u00270.tmp\u0027)"},{"line_number":138,"context_line":"        create_success \u003d False"},{"line_number":139,"context_line":"        try:"},{"line_number":140,"context_line":"            with open(key_file, \u0027w\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_6b031843","line":137,"in_reply_to":"da4df55a_55b8b7e5","updated":"2016-12-23 09:41:30.000000000","message":"Because /tmp and /etc/keystone/fernet-keys may not be in the same filesystem. It is possible to successfully write /tmp/0.tmp and failed to copy to /etc/keystone/fernet-keys.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"ebb63464df3283c478e18302e701ea1a05e4df2f","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            with open(key_file, \u0027w\u0027) as f:"},{"line_number":141,"context_line":"                # convert key to str for the file."},{"line_number":142,"context_line":"                f.write(key.decode(\u0027utf-8\u0027))"},{"line_number":143,"context_line":"                f.flush()"},{"line_number":144,"context_line":"                create_success \u003d True"},{"line_number":145,"context_line":"        except IOError:"},{"line_number":146,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_552a772d","line":143,"updated":"2016-12-23 07:51:53.000000000","message":"This isn\u0027t really needed. A flush will be called as part of the close which will happen when outside the scope of the with open context manager.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"aca52a80035d9562c1b2bf92650c4a2b86a49d19","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            with open(key_file, \u0027w\u0027) as f:"},{"line_number":141,"context_line":"                # convert key to str for the file."},{"line_number":142,"context_line":"                f.write(key.decode(\u0027utf-8\u0027))"},{"line_number":143,"context_line":"                f.flush()"},{"line_number":144,"context_line":"                create_success \u003d True"},{"line_number":145,"context_line":"        except IOError:"},{"line_number":146,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_66b8afe6","line":143,"in_reply_to":"da4df55a_552a772d","updated":"2016-12-23 09:41:30.000000000","message":"I removed the flush(), and then no exceptions were raised when the disk is full. I guess close() doesn\u0027t automatically call flush(), but I can\u0027t find any reference for that.\n\nAlso, when I mock flush() to raise IOError in the unit test, removing the flush() call also prevent IOError to be raised.\n\nIn conclusion, I think the flush() is necessary.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"ebb63464df3283c478e18302e701ea1a05e4df2f","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                f.flush()"},{"line_number":144,"context_line":"                create_success \u003d True"},{"line_number":145,"context_line":"        except IOError:"},{"line_number":146,"context_line":"            pass"},{"line_number":147,"context_line":"        finally:"},{"line_number":148,"context_line":"            # After writing the key, set the umask back to it\u0027s original value."},{"line_number":149,"context_line":"            # Do the same with group and user identifiers if a Keystone group"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_d55107da","line":146,"updated":"2016-12-23 07:51:53.000000000","message":"Generally its better to always do something in the except block, even if its just logging the error.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"aca52a80035d9562c1b2bf92650c4a2b86a49d19","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                f.flush()"},{"line_number":144,"context_line":"                create_success \u003d True"},{"line_number":145,"context_line":"        except IOError:"},{"line_number":146,"context_line":"            pass"},{"line_number":147,"context_line":"        finally:"},{"line_number":148,"context_line":"            # After writing the key, set the umask back to it\u0027s original value."},{"line_number":149,"context_line":"            # Do the same with group and user identifiers if a Keystone group"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_a6ca976c","line":146,"in_reply_to":"da4df55a_d55107da","updated":"2016-12-23 09:41:30.000000000","message":"I see. I will leave some error logs.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"ebb63464df3283c478e18302e701ea1a05e4df2f","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        os.rename(tmp_key_file, valid_key_file)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        LOG.info(_LI(\u0027Become a valid new key: %s\u0027), valid_key_file)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def initialize_key_repository(self, keystone_user_id\u003dNone,"},{"line_number":179,"context_line":"                                  keystone_group_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_d568278a","line":176,"updated":"2016-12-23 07:51:53.000000000","message":"This LOG info messages are pretty verbose. I\u0027d remove them and focus on logging errors.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"aca52a80035d9562c1b2bf92650c4a2b86a49d19","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        os.rename(tmp_key_file, valid_key_file)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        LOG.info(_LI(\u0027Become a valid new key: %s\u0027), valid_key_file)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def initialize_key_repository(self, keystone_user_id\u003dNone,"},{"line_number":179,"context_line":"                                  keystone_group_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_86cbd352","line":176,"in_reply_to":"da4df55a_d568278a","updated":"2016-12-23 09:41:30.000000000","message":"I think it\u0027s good to keep the log since there is a \"Created a new key: /etc/keystone/fernet-keys/0.tmp\" log before it.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"11d050208c9af83558580ed091fd7a0d8e056f07","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                os.remove(key_file)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        if create_success:"},{"line_number":160,"context_line":"            LOG.info(_LI(\u0027Created a new key: %s\u0027), key_file)"},{"line_number":161,"context_line":"        else:"},{"line_number":162,"context_line":"            LOG.error(_LE(\u0027Failed to create a new key: %s\u0027), key_file)"},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_59c1b72d","line":160,"range":{"start_line":160,"start_character":26,"end_line":160,"end_character":43},"updated":"2016-12-23 21:57:19.000000000","message":"Maybe better as \"Created new temporary key 0.tmp\"","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b19606135bede9ee2f89cb5cd6a6e30e0cd62d54","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                os.remove(key_file)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        if create_success:"},{"line_number":160,"context_line":"            LOG.info(_LI(\u0027Created a new key: %s\u0027), key_file)"},{"line_number":161,"context_line":"        else:"},{"line_number":162,"context_line":"            LOG.error(_LE(\u0027Failed to create a new key: %s\u0027), key_file)"},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_935bf22d","line":160,"range":{"start_line":160,"start_character":26,"end_line":160,"end_character":43},"in_reply_to":"da4df55a_59c1b72d","updated":"2016-12-25 05:41:14.000000000","message":"++","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"6176bd75a9973d43abe3557d09a042dda271d1de","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                os.remove(key_file)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        if create_success:"},{"line_number":160,"context_line":"            LOG.info(_LI(\u0027Created a new key: %s\u0027), key_file)"},{"line_number":161,"context_line":"        else:"},{"line_number":162,"context_line":"            LOG.error(_LE(\u0027Failed to create a new key: %s\u0027), key_file)"},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_eec0da7e","line":160,"range":{"start_line":160,"start_character":26,"end_line":160,"end_character":43},"in_reply_to":"da4df55a_59c1b72d","updated":"2016-12-24 03:02:48.000000000","message":"I agree.","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b19606135bede9ee2f89cb5cd6a6e30e0cd62d54","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        return create_success"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _become_valid_new_key(self):"},{"line_number":167,"context_line":"        \"\"\"Make the tmp new key become a valid new key."},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        The tmp new key must be created by _create_tmp_new_key()."}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_1308e32b","line":166,"range":{"start_line":166,"start_character":4,"end_line":166,"end_character":36},"updated":"2016-12-25 05:41:14.000000000","message":"Hmm, I think all that\u0027s been done here is rename, the method name confuse me a little.","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"c2e6f51d11ba7ba5efc78b17ebbcc423e2300a64","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        return create_success"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _become_valid_new_key(self):"},{"line_number":167,"context_line":"        \"\"\"Make the tmp new key become a valid new key."},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        The tmp new key must be created by _create_tmp_new_key()."}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_968760d6","line":166,"range":{"start_line":166,"start_character":4,"end_line":166,"end_character":36},"in_reply_to":"da4df55a_1308e32b","updated":"2016-12-25 11:46:06.000000000","message":"Do you have any good suggestion on that?","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b19606135bede9ee2f89cb5cd6a6e30e0cd62d54","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        return create_success"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _become_valid_new_key(self):"},{"line_number":167,"context_line":"        \"\"\"Make the tmp new key become a valid new key."},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        The tmp new key must be created by _create_tmp_new_key()."},{"line_number":170,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_33032711","line":167,"range":{"start_line":167,"start_character":32,"end_line":167,"end_character":38},"updated":"2016-12-25 05:41:14.000000000","message":"delete \"become\" I think.","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"c2e6f51d11ba7ba5efc78b17ebbcc423e2300a64","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        return create_success"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _become_valid_new_key(self):"},{"line_number":167,"context_line":"        \"\"\"Make the tmp new key become a valid new key."},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        The tmp new key must be created by _create_tmp_new_key()."},{"line_number":170,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_b66e242d","line":167,"range":{"start_line":167,"start_character":32,"end_line":167,"end_character":38},"in_reply_to":"da4df55a_33032711","updated":"2016-12-25 11:46:06.000000000","message":"I will.","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"11d050208c9af83558580ed091fd7a0d8e056f07","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        os.rename(tmp_key_file, valid_key_file)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        LOG.info(_LI(\u0027Become a valid new key: %s\u0027), valid_key_file)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def initialize_key_repository(self, keystone_user_id\u003dNone,"},{"line_number":179,"context_line":"                                  keystone_group_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_19c72f46","line":176,"range":{"start_line":176,"start_character":22,"end_line":176,"end_character":28},"updated":"2016-12-23 21:57:19.000000000","message":"\"become\" sounds little strange to me. Because if I saw these messages, I would assume the key was created with message \"Created a new key\".  \n\nRather than \"become\", maybe replace with \"Renamed temporary key 0.tmp to 0\"","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"11d050208c9af83558580ed091fd7a0d8e056f07","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        os.rename(tmp_key_file, valid_key_file)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        LOG.info(_LI(\u0027Become a valid new key: %s\u0027), valid_key_file)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def initialize_key_repository(self, keystone_user_id\u003dNone,"},{"line_number":179,"context_line":"                                  keystone_group_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_99931f4f","line":176,"range":{"start_line":176,"start_character":22,"end_line":176,"end_character":44},"updated":"2016-12-23 21:57:19.000000000","message":"This sentence sounds a little awkward. Instead of \"become\", maybe","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"6176bd75a9973d43abe3557d09a042dda271d1de","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        os.rename(tmp_key_file, valid_key_file)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        LOG.info(_LI(\u0027Become a valid new key: %s\u0027), valid_key_file)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def initialize_key_repository(self, keystone_user_id\u003dNone,"},{"line_number":179,"context_line":"                                  keystone_group_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_6e3b0a9d","line":176,"range":{"start_line":176,"start_character":22,"end_line":176,"end_character":44},"in_reply_to":"da4df55a_99931f4f","updated":"2016-12-24 03:02:48.000000000","message":"Thank you for the suggestion! I wasn\u0027t sure about the term \"become\" either because I\u0027m not a native English speaker. I will change to \"rename\".\n\nShould I change \"become\" in the function name too?","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b19606135bede9ee2f89cb5cd6a6e30e0cd62d54","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            return"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        # bootstrap an existing key"},{"line_number":193,"context_line":"        self._create_new_key(keystone_user_id, keystone_group_id)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        # ensure that we end up with a primary and secondary key"},{"line_number":196,"context_line":"        self.rotate_keys(keystone_user_id, keystone_group_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_9324d2af","line":193,"range":{"start_line":193,"start_character":8,"end_line":193,"end_character":65},"updated":"2016-12-25 05:41:14.000000000","message":"What will it be if the new key is failed to be created? your code @110-@112 just return silently, what will the following method ends up with?","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"c2e6f51d11ba7ba5efc78b17ebbcc423e2300a64","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            return"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        # bootstrap an existing key"},{"line_number":193,"context_line":"        self._create_new_key(keystone_user_id, keystone_group_id)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        # ensure that we end up with a primary and secondary key"},{"line_number":196,"context_line":"        self.rotate_keys(keystone_user_id, keystone_group_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_56641848","line":193,"range":{"start_line":193,"start_character":8,"end_line":193,"end_character":65},"in_reply_to":"da4df55a_9324d2af","updated":"2016-12-25 11:46:06.000000000","message":"The following rotate_keys() will find no staged key and fail at the rename() @250.\n\nI guess raise an exception in _create_new_tmp_key() will be a good idea.","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b19606135bede9ee2f89cb5cd6a6e30e0cd62d54","unresolved":false,"context_lines":[{"line_number":232,"context_line":"            \u0027count\u0027: len(key_files),"},{"line_number":233,"context_line":"            \u0027list\u0027: list(key_files.values())})"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        # add a tmp new key to the rotation, which will be the *next* primary"},{"line_number":236,"context_line":"        create_success \u003d self._create_tmp_new_key("},{"line_number":237,"context_line":"            keystone_user_id, keystone_group_id)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        if not create_success:"},{"line_number":240,"context_line":"            LOG.error(_LE(\u0027Failed to rotate keys\u0027))"},{"line_number":241,"context_line":"            return"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        # determine the number of the new primary key"},{"line_number":244,"context_line":"        current_primary_key \u003d max(key_files.keys())"}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_1331c2ec","line":241,"range":{"start_line":235,"start_character":0,"end_line":241,"end_character":18},"updated":"2016-12-25 05:41:14.000000000","message":"per my understanding you needn\u0027t change the code this way, you can just raise an exception appropriately if the new key is failed to be created, so that your code in @261 also needn\u0027t.","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"c2e6f51d11ba7ba5efc78b17ebbcc423e2300a64","unresolved":false,"context_lines":[{"line_number":232,"context_line":"            \u0027count\u0027: len(key_files),"},{"line_number":233,"context_line":"            \u0027list\u0027: list(key_files.values())})"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        # add a tmp new key to the rotation, which will be the *next* primary"},{"line_number":236,"context_line":"        create_success \u003d self._create_tmp_new_key("},{"line_number":237,"context_line":"            keystone_user_id, keystone_group_id)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        if not create_success:"},{"line_number":240,"context_line":"            LOG.error(_LE(\u0027Failed to rotate keys\u0027))"},{"line_number":241,"context_line":"            return"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        # determine the number of the new primary key"},{"line_number":244,"context_line":"        current_primary_key \u003d max(key_files.keys())"}],"source_content_type":"text/x-python","patch_set":6,"id":"da4df55a_f64fccba","line":241,"range":{"start_line":235,"start_character":0,"end_line":241,"end_character":18},"in_reply_to":"da4df55a_1331c2ec","updated":"2016-12-25 11:46:06.000000000","message":"I will use exceptions to control the creation of the staged key. Thanks.","commit_id":"cbc17f596b1b32e6aad0f4596455e2e8f47e2b07"}],"keystone/tests/unit/token/test_fernet_provider.py":[{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"ebb63464df3283c478e18302e701ea1a05e4df2f","unresolved":false,"context_lines":[{"line_number":15,"context_line":"import hashlib"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"import uuid"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import msgpack"},{"line_number":21,"context_line":"from oslo_utils import timeutils"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_f5d0cb55","line":18,"updated":"2016-12-23 07:51:53.000000000","message":"mock should come after hashlib to keep alpha sorted order","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"aca52a80035d9562c1b2bf92650c4a2b86a49d19","unresolved":false,"context_lines":[{"line_number":15,"context_line":"import hashlib"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"import uuid"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import msgpack"},{"line_number":21,"context_line":"from oslo_utils import timeutils"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_e6f81f4c","line":18,"in_reply_to":"da4df55a_d572e748","updated":"2016-12-23 09:41:30.000000000","message":"OK, thanks for the tips.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"0637c82caf30061b236a469daa2c2b2b79eacab7","unresolved":false,"context_lines":[{"line_number":15,"context_line":"import hashlib"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"import uuid"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import msgpack"},{"line_number":21,"context_line":"from oslo_utils import timeutils"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_d572e748","line":18,"in_reply_to":"da4df55a_f5d0cb55","updated":"2016-12-23 07:57:11.000000000","message":"Note: this is the source of the pep8 failure\n\n\n2016-12-23 06:17:03.013856 | ./keystone/tests/unit/token/test_fernet_provider.py:18:1: H306  imports not in alphabetical order (uuid, mock)\n2016-12-23 06:17:03.015107 | import mock\n2016-12-23 06:17:03.015128 | ^","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"aca52a80035d9562c1b2bf92650c4a2b86a49d19","unresolved":false,"context_lines":[{"line_number":15,"context_line":"import hashlib"},{"line_number":16,"context_line":"import os"},{"line_number":17,"context_line":"import uuid"},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import msgpack"},{"line_number":21,"context_line":"from oslo_utils import timeutils"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_067a83f1","line":18,"in_reply_to":"da4df55a_f5d0cb55","updated":"2016-12-23 09:41:30.000000000","message":"Sorry, I didn\u0027t run pep8 first.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"0637c82caf30061b236a469daa2c2b2b79eacab7","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        file_handle \u003d mock_open()"},{"line_number":657,"context_line":"        file_handle.flush.side_effect \u003d IOError(\u0027disk full\u0027)"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"        with mock.patch(\u0027__builtin__.open\u0027, mock_open):"},{"line_number":660,"context_line":"            key_utils.rotate_keys()"},{"line_number":661,"context_line":"            # Assert that the key repository is unchanged"},{"line_number":662,"context_line":"            self.assertRepositoryState(expected_size\u003d2)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_d5ee67b3","line":659,"updated":"2016-12-23 07:57:11.000000000","message":"The __builtin__ module was renamed to builtins in Python3.\n\nTraceback (most recent call last):\n  File \"/home/jenkins/workspace/gate-keystone-python35-db/keystone/tests/unit/token/test_fernet_provider.py\", line 659, in test_rotation_disk_write_fail\n    with mock.patch(\u0027__builtin__.open\u0027, mock_open):\n  File \"/home/jenkins/workspace/gate-keystone-python35-db/.tox/py35/lib/python3.5/site-packages/mock/mock.py\", line 1353, in __enter__\n    self.target \u003d self.getter()\n  File \"/home/jenkins/workspace/gate-keystone-python35-db/.tox/py35/lib/python3.5/site-packages/mock/mock.py\", line 1523, in \u003clambda\u003e\n    getter \u003d lambda: _importer(target)\n  File \"/home/jenkins/workspace/gate-keystone-python35-db/.tox/py35/lib/python3.5/site-packages/mock/mock.py\", line 1206, in _importer\n    thing \u003d __import__(import_path)\nImportError: No module named \u0027__builtin__\u0027","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"aca52a80035d9562c1b2bf92650c4a2b86a49d19","unresolved":false,"context_lines":[{"line_number":656,"context_line":"        file_handle \u003d mock_open()"},{"line_number":657,"context_line":"        file_handle.flush.side_effect \u003d IOError(\u0027disk full\u0027)"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"        with mock.patch(\u0027__builtin__.open\u0027, mock_open):"},{"line_number":660,"context_line":"            key_utils.rotate_keys()"},{"line_number":661,"context_line":"            # Assert that the key repository is unchanged"},{"line_number":662,"context_line":"            self.assertRepositoryState(expected_size\u003d2)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_46e9eb7f","line":659,"in_reply_to":"da4df55a_d5ee67b3","updated":"2016-12-23 09:41:30.000000000","message":"I will rename it to \"keystone.common.fernet_utils.open\". Thank you.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"0637c82caf30061b236a469daa2c2b2b79eacab7","unresolved":false,"context_lines":[{"line_number":661,"context_line":"            # Assert that the key repository is unchanged"},{"line_number":662,"context_line":"            self.assertRepositoryState(expected_size\u003d2)"},{"line_number":663,"context_line":""},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    def test_non_numeric_files(self):"},{"line_number":666,"context_line":"        self.useFixture("},{"line_number":667,"context_line":"            ksfixtures.KeyRepository("}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_b5ae4383","line":664,"updated":"2016-12-23 07:57:11.000000000","message":"Remove this line.  This is the source of the 2nd pep8 error.\n\n2016-12-23 06:17:03.015153 | ./keystone/tests/unit/token/test_fernet_provider.py:665:5: E303 too many blank lines (2)\n2016-12-23 06:17:03.015167 |     def test_non_numeric_files(self):","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":24651,"name":"John Lin","email":"johnlinp@gmail.com","username":"johnlinp"},"change_message_id":"aca52a80035d9562c1b2bf92650c4a2b86a49d19","unresolved":false,"context_lines":[{"line_number":661,"context_line":"            # Assert that the key repository is unchanged"},{"line_number":662,"context_line":"            self.assertRepositoryState(expected_size\u003d2)"},{"line_number":663,"context_line":""},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"    def test_non_numeric_files(self):"},{"line_number":666,"context_line":"        self.useFixture("},{"line_number":667,"context_line":"            ksfixtures.KeyRepository("}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_a6fe1736","line":664,"in_reply_to":"da4df55a_b5ae4383","updated":"2016-12-23 09:41:30.000000000","message":"I will remove it.","commit_id":"fa38a0d72f025d36f91eabd369c3533e60e5d935"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"718602cef4c88768ef3259826fc045db81c25910","unresolved":false,"context_lines":[{"line_number":629,"context_line":"                self.assertEqual(exp_keys, self.keys)"},{"line_number":630,"context_line":""},{"line_number":631,"context_line":"    def test_rotation_disk_write_fail(self):"},{"line_number":632,"context_line":"        max_active_keys \u003d 5"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"        self.config_fixture.config(group\u003d\u0027fernet_tokens\u0027,"},{"line_number":635,"context_line":"                                   max_active_keys\u003dmax_active_keys)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"        # Init the key repository"},{"line_number":638,"context_line":"        self.useFixture("},{"line_number":639,"context_line":"            ksfixtures.KeyRepository("}],"source_content_type":"text/x-python","patch_set":4,"id":"da4df55a_f73e0ad9","line":636,"range":{"start_line":632,"start_character":0,"end_line":636,"end_character":0},"updated":"2016-12-23 11:42:00.000000000","message":"you don\u0027t need these lines, the max active keys by default is 3, since we\u0027re not going past 2 this is not necessary","commit_id":"95721f63ec55201b7bf15b4f029926d4b8758ebe"}]}
