)]}'
{"oslo_policy/policy.py":[{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"0d3a02617ea396d719b63d666804cf608849f594","unresolved":false,"context_lines":[{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    @staticmethod"},{"line_number":461,"context_line":"    def _walk_through_policy_directory(path, func, *args):"},{"line_number":462,"context_line":"        if not os.path.isdir(path):"},{"line_number":463,"context_line":"            raise ValueError(\u0027%s is not a directory\u0027 % path)"},{"line_number":464,"context_line":"        # We do not iterate over sub-directories."},{"line_number":465,"context_line":"        policy_files \u003d next(os.walk(path))[2]"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_fc62073d","line":462,"updated":"2015-12-09 07:00:43.000000000","message":"Do we also want to check if it exists and just return if the path does not exist? are we doing that some where else?","commit_id":"a475547465bb70b5fdf979553595579d9b9e700d"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"0d8ebee39ac3b1dfba4fb31d8f693a6e5495614a","unresolved":false,"context_lines":[{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    @staticmethod"},{"line_number":461,"context_line":"    def _walk_through_policy_directory(path, func, *args):"},{"line_number":462,"context_line":"        if not os.path.isdir(path):"},{"line_number":463,"context_line":"            raise ValueError(\u0027%s is not a directory\u0027 % path)"},{"line_number":464,"context_line":"        # We do not iterate over sub-directories."},{"line_number":465,"context_line":"        policy_files \u003d next(os.walk(path))[2]"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_2f249aad","line":462,"in_reply_to":"7a740942_c2fc0074","updated":"2015-12-10 01:22:57.000000000","message":"+1","commit_id":"a475547465bb70b5fdf979553595579d9b9e700d"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"030f0035742504eba73519ffe20458c21b49afff","unresolved":false,"context_lines":[{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    @staticmethod"},{"line_number":461,"context_line":"    def _walk_through_policy_directory(path, func, *args):"},{"line_number":462,"context_line":"        if not os.path.isdir(path):"},{"line_number":463,"context_line":"            raise ValueError(\u0027%s is not a directory\u0027 % path)"},{"line_number":464,"context_line":"        # We do not iterate over sub-directories."},{"line_number":465,"context_line":"        policy_files \u003d next(os.walk(path))[2]"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_359e12b9","line":462,"in_reply_to":"7a740942_c2fc0074","updated":"2015-12-10 12:28:47.000000000","message":"just double recheck, if the directory doesn\u0027t exist, will skip the directory as below:\n\n            for path in self.conf.oslo_policy.policy_dirs:\n                try:\n                    path \u003d self._get_policy_path(path)\n                except cfg.ConfigFilesNotFoundError:\n                    continue\n\nSo when enter this method ,  path must exist,  here raise ValueError to avoid confusing ERROR (a StopIteration exception)  as the bug described .","commit_id":"a475547465bb70b5fdf979553595579d9b9e700d"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"3539ee00a682c0166cc796de488317e4a50c12fb","unresolved":false,"context_lines":[{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    @staticmethod"},{"line_number":461,"context_line":"    def _walk_through_policy_directory(path, func, *args):"},{"line_number":462,"context_line":"        if not os.path.isdir(path):"},{"line_number":463,"context_line":"            raise ValueError(\u0027%s is not a directory\u0027 % path)"},{"line_number":464,"context_line":"        # We do not iterate over sub-directories."},{"line_number":465,"context_line":"        policy_files \u003d next(os.walk(path))[2]"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_c2fc0074","line":462,"in_reply_to":"7a740942_fc62073d","updated":"2015-12-09 07:55:17.000000000","message":"No, we don\u0027t check the existing of  file path now . we read file in  method _cache_handler.read_cached_file,\nit  will raise IOError when the file path doesn\u0027t exist, that provide enough information for users.\n        with open(filename) as fap:\n            cache_info[\u0027data\u0027] \u003d fap.read()\n\nIMHO, we need raise a exception to tell user we have wrong config value, other than just skipping.\n\nos.path.isdir() also returns False if the patch doesn\u0027t exist, so here we can only use os.path.isdir here,  will add unit test to cover this case .","commit_id":"a475547465bb70b5fdf979553595579d9b9e700d"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"0d8ebee39ac3b1dfba4fb31d8f693a6e5495614a","unresolved":false,"context_lines":[{"line_number":460,"context_line":"    @staticmethod"},{"line_number":461,"context_line":"    def _walk_through_policy_directory(path, func, *args):"},{"line_number":462,"context_line":"        if not os.path.isdir(path):"},{"line_number":463,"context_line":"            raise ValueError(\u0027%s is not a directory\u0027 % path)"},{"line_number":464,"context_line":"        # We do not iterate over sub-directories."},{"line_number":465,"context_line":"        policy_files \u003d next(os.walk(path))[2]"},{"line_number":466,"context_line":"        policy_files.sort()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_afe3aa32","line":463,"updated":"2015-12-10 01:22:57.000000000","message":"but maybe we should tell  what caused this error: wrong config?","commit_id":"a475547465bb70b5fdf979553595579d9b9e700d"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"030f0035742504eba73519ffe20458c21b49afff","unresolved":false,"context_lines":[{"line_number":460,"context_line":"    @staticmethod"},{"line_number":461,"context_line":"    def _walk_through_policy_directory(path, func, *args):"},{"line_number":462,"context_line":"        if not os.path.isdir(path):"},{"line_number":463,"context_line":"            raise ValueError(\u0027%s is not a directory\u0027 % path)"},{"line_number":464,"context_line":"        # We do not iterate over sub-directories."},{"line_number":465,"context_line":"        policy_files \u003d next(os.walk(path))[2]"},{"line_number":466,"context_line":"        policy_files.sort()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_352ff23f","line":463,"in_reply_to":"7a740942_afe3aa32","updated":"2015-12-10 12:28:47.000000000","message":"I think  the information is enough,","commit_id":"a475547465bb70b5fdf979553595579d9b9e700d"}],"oslo_policy/tests/test_policy.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"d211388bb133c02343ffdd0f682a2d34f6fd6170","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        self.conf.set_override(\u0027policy_dirs\u0027,"},{"line_number":249,"context_line":"                               [\u0027policy.d\u0027, \u0027policy.x.d\u0027],"},{"line_number":250,"context_line":"                               group\u003d\u0027oslo_policy\u0027)"},{"line_number":251,"context_line":"        raise ValueError(\u0027%s\u0027, self.conf.oslo_policy.policy_dirs)"},{"line_number":252,"context_line":"        self.enforcer.load_rules(True)"},{"line_number":253,"context_line":"        self.assertIsNotNone(self.enforcer.rules)"},{"line_number":254,"context_line":"        self.assertIn(\u0027default\u0027, self.enforcer.rules)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_b3a713bb","line":251,"updated":"2015-12-12 07:03:49.000000000","message":"maybe add a comment here, it\u0027s weird to just raise something in the middle of the test","commit_id":"6f122b9b8f802fd18321d638c14ae26f21086b9c"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"722680a8fcc6c3bb2f4b6ce02e9e8db9f88b51c6","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        self.conf.set_override(\u0027policy_dirs\u0027,"},{"line_number":249,"context_line":"                               [\u0027policy.d\u0027, \u0027policy.x.d\u0027],"},{"line_number":250,"context_line":"                               group\u003d\u0027oslo_policy\u0027)"},{"line_number":251,"context_line":"        raise ValueError(\u0027%s\u0027, self.conf.oslo_policy.policy_dirs)"},{"line_number":252,"context_line":"        self.enforcer.load_rules(True)"},{"line_number":253,"context_line":"        self.assertIsNotNone(self.enforcer.rules)"},{"line_number":254,"context_line":"        self.assertIn(\u0027default\u0027, self.enforcer.rules)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_331d63be","line":251,"in_reply_to":"7a740942_b3a713bb","updated":"2015-12-12 07:25:54.000000000","message":"this is my test. shouldn\u0027t include this  commit :/","commit_id":"6f122b9b8f802fd18321d638c14ae26f21086b9c"}]}
