)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"8daa48d497aec116af30f6f9acd6cea6b19358e9","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch changes read_cached_file to store the cache information"},{"line_number":13,"context_line":"of the directory. And we check if the policy.d fresh or not before"},{"line_number":14,"context_line":"work though it."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: 1437992"},{"line_number":17,"context_line":"Co-Authored-By: Eli Qiao \u003cliyong.qiao@intel.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da9b358b_7730c69e","line":14,"updated":"2015-04-01 02:19:25.000000000","message":"these need to be changed too.","commit_id":"b275965f54a918ece51bf7fbb1cff1188be4ecf3"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"a49cf7df57afcddfb371f5d9b09330a42b7fdfba","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch changes read_cached_file to store the cache information"},{"line_number":13,"context_line":"of the directory. And we check if the policy.d fresh or not before"},{"line_number":14,"context_line":"work though it."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: 1437992"},{"line_number":17,"context_line":"Co-Authored-By: Eli Qiao \u003cliyong.qiao@intel.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da9b358b_b7a9ae7d","line":14,"in_reply_to":"da9b358b_7730c69e","updated":"2015-04-01 02:26:35.000000000","message":"Done","commit_id":"b275965f54a918ece51bf7fbb1cff1188be4ecf3"}],"oslo_policy/policy.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"87dc1f7dd7d6060fe1823299e77b03e5dabf19bf","unresolved":false,"context_lines":[{"line_number":389,"context_line":"                                                        force_reload, False)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    @staticmethod"},{"line_number":392,"context_line":"    def _is_directory_updated(cache, path):"},{"line_number":393,"context_line":"        # Get the current modified time and compare it to what is in"},{"line_number":394,"context_line":"        # the cache and check if the new mtime is greater than what"},{"line_number":395,"context_line":"        # is in the cache"}],"source_content_type":"text/x-python","patch_set":4,"id":"da9b358b_c9f8174c","line":392,"updated":"2015-04-01 01:06:20.000000000","message":"can we move this as a utils function into oslo-incubator like I did in  https://review.openstack.org/#/c/168819/1 , i think we can add a new function which named is_directory_updated, and only pass path to it(we don\u0027t need to care about the cache, right ?)\n\nEli.","commit_id":"f22cd681ff27858a0a758a47222ed70a277f8d95"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"17c95e1cf3cbbaae2e9f915d548678a60448d464","unresolved":false,"context_lines":[{"line_number":389,"context_line":"                                                        force_reload, False)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    @staticmethod"},{"line_number":392,"context_line":"    def _is_directory_updated(cache, path):"},{"line_number":393,"context_line":"        # Get the current modified time and compare it to what is in"},{"line_number":394,"context_line":"        # the cache and check if the new mtime is greater than what"},{"line_number":395,"context_line":"        # is in the cache"}],"source_content_type":"text/x-python","patch_set":4,"id":"da9b358b_69458b6e","line":392,"in_reply_to":"da9b358b_c9f8174c","updated":"2015-04-01 01:12:00.000000000","message":"just see from the oslo chat log, I am okay with that, let fix it and don\u0027t stuck by fileutils.\nbut still I think that will be a helpful function in fileutils.","commit_id":"f22cd681ff27858a0a758a47222ed70a277f8d95"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"fc3a7977af1a44b59d7d13957f85c2e63989f854","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            files \u003d [path] + [os.path.join(path, file) for file in"},{"line_number":400,"context_line":"                              os.listdir(path)]"},{"line_number":401,"context_line":"            # Pick the newest one, let\u0027s use its time."},{"line_number":402,"context_line":"            mtime \u003d os.path.getmtime(max(files, key\u003dos.path.getmtime))"},{"line_number":403,"context_line":"        cache_info \u003d cache.setdefault(path, {})"},{"line_number":404,"context_line":"        if mtime \u003e cache_info.get(\u0027mtime\u0027, 0):"},{"line_number":405,"context_line":"            cache_info[\u0027mtime\u0027] \u003d mtime"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9b358b_d7baf222","line":402,"updated":"2015-04-01 02:17:38.000000000","message":"do we really need to loop all files ?\nI don\u0027t think so, see my previous testing..","commit_id":"5d2f7f7d51056eccc7fb9de03504b00826c55af5"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"9bd02be751c00a2cae6cda68732579783015c601","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            files \u003d [path] + [os.path.join(path, file) for file in"},{"line_number":400,"context_line":"                              os.listdir(path)]"},{"line_number":401,"context_line":"            # Pick the newest one, let\u0027s use its time."},{"line_number":402,"context_line":"            mtime \u003d os.path.getmtime(max(files, key\u003dos.path.getmtime))"},{"line_number":403,"context_line":"        cache_info \u003d cache.setdefault(path, {})"},{"line_number":404,"context_line":"        if mtime \u003e cache_info.get(\u0027mtime\u0027, 0):"},{"line_number":405,"context_line":"            cache_info[\u0027mtime\u0027] \u003d mtime"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9b358b_57b142e0","line":402,"in_reply_to":"da9b358b_d7a0b2a1","updated":"2015-04-01 02:27:34.000000000","message":"thanks dims, we need to pay more attention for oslo project.\nI am agree with you.\n\nbut please update commit message in ps 7\n\nthanks Eli.","commit_id":"5d2f7f7d51056eccc7fb9de03504b00826c55af5"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"69ceeffe7970762ab693e99a4a4870feb6fef940","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            files \u003d [path] + [os.path.join(path, file) for file in"},{"line_number":400,"context_line":"                              os.listdir(path)]"},{"line_number":401,"context_line":"            # Pick the newest one, let\u0027s use its time."},{"line_number":402,"context_line":"            mtime \u003d os.path.getmtime(max(files, key\u003dos.path.getmtime))"},{"line_number":403,"context_line":"        cache_info \u003d cache.setdefault(path, {})"},{"line_number":404,"context_line":"        if mtime \u003e cache_info.get(\u0027mtime\u0027, 0):"},{"line_number":405,"context_line":"            cache_info[\u0027mtime\u0027] \u003d mtime"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9b358b_d7a0b2a1","line":402,"in_reply_to":"da9b358b_d7baf222","updated":"2015-04-01 02:24:19.000000000","message":"Yes, we need it. It\u0027s apparently a well known \"feature\" - http://serverfault.com/questions/388050/does-directory-mtime-always-change-when-a-new-file-is-created-inside","commit_id":"5d2f7f7d51056eccc7fb9de03504b00826c55af5"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"74c3fc6cbd790f491ec7656681bf9f410319e1c1","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                    path \u003d self._get_policy_path(path)"},{"line_number":383,"context_line":"                except cfg.ConfigFilesNotFoundError:"},{"line_number":384,"context_line":"                    continue"},{"line_number":385,"context_line":"                if (force_reload or self._is_directory_updated("},{"line_number":386,"context_line":"                        self._policy_dir_mtimes, path)):"},{"line_number":387,"context_line":"                    self._walk_through_policy_directory(path,"},{"line_number":388,"context_line":"                                                        self._load_policy_file,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_6fd7c623","line":385,"updated":"2015-04-01 07:25:44.000000000","message":"whats the reason for checking force_reload here again?","commit_id":"b5f07dfe4cd4a5d12c7fecbc3954694d934de642"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"7e1b8a66def0afc03482fbeff92cc192b3237adb","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                    path \u003d self._get_policy_path(path)"},{"line_number":383,"context_line":"                except cfg.ConfigFilesNotFoundError:"},{"line_number":384,"context_line":"                    continue"},{"line_number":385,"context_line":"                if (force_reload or self._is_directory_updated("},{"line_number":386,"context_line":"                        self._policy_dir_mtimes, path)):"},{"line_number":387,"context_line":"                    self._walk_through_policy_directory(path,"},{"line_number":388,"context_line":"                                                        self._load_policy_file,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_ef919653","line":385,"in_reply_to":"da9b358b_6fd7c623","updated":"2015-04-01 07:28:23.000000000","message":"My understand is whatever the directory is updated or not, if force_reload\u003dTrue, then we reload all the policy files from policy.d.","commit_id":"b5f07dfe4cd4a5d12c7fecbc3954694d934de642"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"382c6c580ac856ede22eb026d32b04a9b30b748a","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                    path \u003d self._get_policy_path(path)"},{"line_number":383,"context_line":"                except cfg.ConfigFilesNotFoundError:"},{"line_number":384,"context_line":"                    continue"},{"line_number":385,"context_line":"                if (force_reload or self._is_directory_updated("},{"line_number":386,"context_line":"                        self._policy_dir_mtimes, path)):"},{"line_number":387,"context_line":"                    self._walk_through_policy_directory(path,"},{"line_number":388,"context_line":"                                                        self._load_policy_file,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_0f04ba47","line":385,"in_reply_to":"da9b358b_ef919653","updated":"2015-04-01 07:36:41.000000000","message":"right, duh. the rest of this looks good","commit_id":"b5f07dfe4cd4a5d12c7fecbc3954694d934de642"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"f93effef21ff39b8998d28b1abb2892a2eb10943","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                except cfg.ConfigFilesNotFoundError:"},{"line_number":384,"context_line":"                    continue"},{"line_number":385,"context_line":"                if (force_reload or self._is_directory_updated("},{"line_number":386,"context_line":"                        self._policy_dir_mtimes, path)):"},{"line_number":387,"context_line":"                    self._walk_through_policy_directory(path,"},{"line_number":388,"context_line":"                                                        self._load_policy_file,"},{"line_number":389,"context_line":"                                                        force_reload, False)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baa041b7_a7ce7a58","line":386,"updated":"2015-04-02 00:06:44.000000000","message":"if _is_directory_updated wasn\u0027t a static method then wouldn\u0027t need to pass in self._policy_dir_mtimes.","commit_id":"b5f07dfe4cd4a5d12c7fecbc3954694d934de642"}],"oslo_policy/tests/test_policy.py":[{"author":{"_account_id":2218,"name":"Adam Young","email":"adam@younglogic.com","username":"ayoung"},"change_message_id":"a11c7ededb098e32d270efa57716e9a9a5fb7e64","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            \u0027policy.d/b.conf\u0027,"},{"line_number":174,"context_line":"        ])"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    @mock.patch(\u0027os.path.getmtime\u0027)"},{"line_number":177,"context_line":"    def test_load_directory_caching_with_files_updated(self, mock_getmtime):"},{"line_number":178,"context_line":"        returns \u003d {"},{"line_number":179,"context_line":"            \u0027/policy.json\u0027: 1427836546,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da9b358b_8c4e9d94","line":176,"updated":"2015-04-01 02:02:41.000000000","message":"I don\u0027t think we should be mocking out the FS operations.  What matters is how the FS actually operates;  if our mock assumptions are wrong, the code is wrong, and mock just masks it.","commit_id":"5d2f7f7d51056eccc7fb9de03504b00826c55af5"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"f93effef21ff39b8998d28b1abb2892a2eb10943","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    def test_load_directory_caching_with_files_updated(self):"},{"line_number":179,"context_line":"        self.create_config_file(\u0027policy.d/a.conf\u0027, POLICY_A_CONTENTS)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        self.enforcer.load_rules(False)"},{"line_number":182,"context_line":"        self.assertIsNotNone(self.enforcer.rules)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        old \u003d six.next(six.itervalues("}],"source_content_type":"text/x-python","patch_set":8,"id":"baa041b7_a7d8baf0","line":181,"updated":"2015-04-02 00:06:44.000000000","message":"suggest give a name to the False parameter here so readers know what it is.","commit_id":"b5f07dfe4cd4a5d12c7fecbc3954694d934de642"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"f93effef21ff39b8998d28b1abb2892a2eb10943","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        self.assertIsNotNone(self.enforcer.rules)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        old \u003d six.next(six.itervalues("},{"line_number":185,"context_line":"            self.enforcer._policy_dir_mtimes))"},{"line_number":186,"context_line":"        self.assertEqual(1, len(self.enforcer._policy_dir_mtimes))"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        # Touch the file"}],"source_content_type":"text/x-python","patch_set":8,"id":"baa041b7_47ee8e8c","line":185,"updated":"2015-04-02 00:06:44.000000000","message":"what is this doing? add a comment.","commit_id":"b5f07dfe4cd4a5d12c7fecbc3954694d934de642"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"f93effef21ff39b8998d28b1abb2892a2eb10943","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        old \u003d six.next(six.itervalues("},{"line_number":185,"context_line":"            self.enforcer._policy_dir_mtimes))"},{"line_number":186,"context_line":"        self.assertEqual(1, len(self.enforcer._policy_dir_mtimes))"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        # Touch the file"},{"line_number":189,"context_line":"        conf_path \u003d os.path.join(self.config_dir, \u0027policy.d/a.conf\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baa041b7_a751da64","line":186,"updated":"2015-04-02 00:06:44.000000000","message":"suggest use HasLength matcher.","commit_id":"b5f07dfe4cd4a5d12c7fecbc3954694d934de642"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"f93effef21ff39b8998d28b1abb2892a2eb10943","unresolved":false,"context_lines":[{"line_number":338,"context_line":"                                use_conf\u003dTrue)"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"        self.enforcer.overwrite \u003d False"},{"line_number":341,"context_line":"        self.enforcer._is_directory_updated \u003d lambda x, y: True"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        # Call enforce(), it will load rules from"},{"line_number":344,"context_line":"        # policy configuration files, to merge with"}],"source_content_type":"text/x-python","patch_set":8,"id":"baa041b7_279a6a15","line":341,"updated":"2015-04-02 00:06:44.000000000","message":"use mock.patch.object() for this so it\u0027s more obvious what it\u0027s doing.","commit_id":"b5f07dfe4cd4a5d12c7fecbc3954694d934de642"}]}
