)]}'
{"swift/obj/diskfile.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"556e1f0798fca8ea7451a0c75a2a3e1c28eb1662","unresolved":false,"context_lines":[{"line_number":431,"context_line":"            if \u0027-\u0027 in dir:"},{"line_number":432,"context_line":"                base, policy_idx \u003d dir.split(\u0027-\u0027, 1)"},{"line_number":433,"context_line":"            try:"},{"line_number":434,"context_line":"                get_data_dir(policy_idx)"},{"line_number":435,"context_line":"            except ValueError:"},{"line_number":436,"context_line":"                if logger:"},{"line_number":437,"context_line":"                    logger.warn(_(\u0027Directory %s does not map to a \u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_2385e506","line":434,"updated":"2014-06-11 13:17:21.000000000","message":"i *think* that this does NOT raise the ValueError if dir\u003d\u0027objects-\u0027 because policy_idx\u003d\u0027\u0027 and storage_policy.get_by_index will map that to policy 0. There is similar code in updater.py line 158 where an int(policy_index) is done first which will blow up for policy_index\u003d\u0027\u0027. Maybe that\u0027s needed here too, or maybe storage_policy.get_by_index() line 233 needs to be\n\n  index \u003d int(index) if index is not None else 0\n\nAlso, there\u0027s probably scope to refactor these and maybe other locations into a storage_policy.get_policy_index() helper to complement get_policy_string() - actually, maybe diskfile.extract_policy_index almost does it but insists on a training \u0027/\u0027.","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"9b03c955a4cd384347b223d483725a6a6069e318","unresolved":false,"context_lines":[{"line_number":431,"context_line":"            if \u0027-\u0027 in dir:"},{"line_number":432,"context_line":"                base, policy_idx \u003d dir.split(\u0027-\u0027, 1)"},{"line_number":433,"context_line":"            try:"},{"line_number":434,"context_line":"                get_data_dir(policy_idx)"},{"line_number":435,"context_line":"            except ValueError:"},{"line_number":436,"context_line":"                if logger:"},{"line_number":437,"context_line":"                    logger.warn(_(\u0027Directory %s does not map to a \u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_c3451c44","line":434,"in_reply_to":"1ae5cdf2_2385e506","updated":"2014-06-11 13:39:51.000000000","message":"that\u0027s right, \u0027objects-\u0027 would map to policy 0.  Once merged I\u0027d agree, we can probably iterate on some of these helpers - again :)","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0c996b0d3ef2979f25d4742b513e045b88ff74df","unresolved":false,"context_lines":[{"line_number":431,"context_line":"            if \u0027-\u0027 in dir:"},{"line_number":432,"context_line":"                base, policy_idx \u003d dir.split(\u0027-\u0027, 1)"},{"line_number":433,"context_line":"            try:"},{"line_number":434,"context_line":"                get_data_dir(policy_idx)"},{"line_number":435,"context_line":"            except ValueError:"},{"line_number":436,"context_line":"                if logger:"},{"line_number":437,"context_line":"                    logger.warn(_(\u0027Directory %s does not map to a \u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_c570890a","line":434,"in_reply_to":"1ae5cdf2_c3451c44","updated":"2014-06-12 23:27:01.000000000","message":"I don\u0027t think we\u0027re doing anything with the policy-index here?  And when i run the auditor with my objects directory renamed to \"objects-\" I get a warning:\n\nobject-6010: Directory objects- does not map to a valid policy\n\nThen it audits everything in the directory.\n\nI don\u0027t know what the desired behavior is, we could make it not warn?  I think the existing auditor would just skip that directory; seems worse in this case though.","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"}],"test/unit/obj/test_auditor.py":[{"author":{"_account_id":5600,"name":"Brian Cline","email":"bcline@softlayer.com","username":"briancline"},"change_message_id":"2a86bccb41ebdf72789c94e5999e40143db86d2e","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        data \u003d \u00270\u0027 * 1024"},{"line_number":225,"context_line":"        etag \u003d md5()"},{"line_number":226,"context_line":"        # policy 0"},{"line_number":227,"context_line":"        with self.disk_file.create() as writer:"},{"line_number":228,"context_line":"            writer.write(data)"},{"line_number":229,"context_line":"            etag.update(data)"},{"line_number":230,"context_line":"            etag \u003d etag.hexdigest()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_427f0f66","line":227,"updated":"2014-06-05 06:28:19.000000000","message":"For future maintainability, can these two blocks be collapsed into one since they\u0027re doing the same thing with different inputs, perhaps with an inner function?","commit_id":"ebe36fb585b8c66534d76673ecfc7067eda0bca7"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"855c6e86d9b052059e255a5d020231d0675dbccd","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        data \u003d \u00270\u0027 * 1024"},{"line_number":225,"context_line":"        etag \u003d md5()"},{"line_number":226,"context_line":"        # policy 0"},{"line_number":227,"context_line":"        with self.disk_file.create() as writer:"},{"line_number":228,"context_line":"            writer.write(data)"},{"line_number":229,"context_line":"            etag.update(data)"},{"line_number":230,"context_line":"            etag \u003d etag.hexdigest()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_5b5a962a","line":227,"in_reply_to":"1ae5cdf2_427f0f66","updated":"2014-06-05 08:24:57.000000000","message":"Done","commit_id":"ebe36fb585b8c66534d76673ecfc7067eda0bca7"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"556e1f0798fca8ea7451a0c75a2a3e1c28eb1662","unresolved":false,"context_lines":[{"line_number":262,"context_line":"            writer.put(metadata)"},{"line_number":263,"context_line":"        auditor_worker.audit_all_objects(device_dirs\u003d[\u0027sda\u0027, \u0027sdb\u0027])"},{"line_number":264,"context_line":"        self.assertEquals(auditor_worker.quarantines, pre_quarantines)"},{"line_number":265,"context_line":"        # still have a 1024 byte object in policy-0 (plus the original 2)"},{"line_number":266,"context_line":"        self.assertEquals(auditor_worker.stats_buckets[1024], 3)"},{"line_number":267,"context_line":"        self.assertEquals(auditor_worker.stats_buckets[10240], 0)"},{"line_number":268,"context_line":"        # and the policy-1 object has been re-written as a larger object"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_1d104158","line":265,"updated":"2014-06-11 13:17:21.000000000","message":"are the policies swapped in the comments here - isn\u0027t the large object in policy-0?","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"9b03c955a4cd384347b223d483725a6a6069e318","unresolved":false,"context_lines":[{"line_number":262,"context_line":"            writer.put(metadata)"},{"line_number":263,"context_line":"        auditor_worker.audit_all_objects(device_dirs\u003d[\u0027sda\u0027, \u0027sdb\u0027])"},{"line_number":264,"context_line":"        self.assertEquals(auditor_worker.quarantines, pre_quarantines)"},{"line_number":265,"context_line":"        # still have a 1024 byte object in policy-0 (plus the original 2)"},{"line_number":266,"context_line":"        self.assertEquals(auditor_worker.stats_buckets[1024], 3)"},{"line_number":267,"context_line":"        self.assertEquals(auditor_worker.stats_buckets[10240], 0)"},{"line_number":268,"context_line":"        # and the policy-1 object has been re-written as a larger object"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_63144844","line":265,"in_reply_to":"1ae5cdf2_1d104158","updated":"2014-06-11 13:39:51.000000000","message":"yeah, the comment below should say policy-0 not policy-1","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0c996b0d3ef2979f25d4742b513e045b88ff74df","unresolved":false,"context_lines":[{"line_number":262,"context_line":"            writer.put(metadata)"},{"line_number":263,"context_line":"        auditor_worker.audit_all_objects(device_dirs\u003d[\u0027sda\u0027, \u0027sdb\u0027])"},{"line_number":264,"context_line":"        self.assertEquals(auditor_worker.quarantines, pre_quarantines)"},{"line_number":265,"context_line":"        # still have a 1024 byte object in policy-0 (plus the original 2)"},{"line_number":266,"context_line":"        self.assertEquals(auditor_worker.stats_buckets[1024], 3)"},{"line_number":267,"context_line":"        self.assertEquals(auditor_worker.stats_buckets[10240], 0)"},{"line_number":268,"context_line":"        # and the policy-1 object has been re-written as a larger object"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_85d841f0","line":265,"in_reply_to":"1ae5cdf2_63144844","updated":"2014-06-12 23:27:01.000000000","message":"Done","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"}],"test/unit/obj/test_diskfile.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"556e1f0798fca8ea7451a0c75a2a3e1c28eb1662","unresolved":false,"context_lines":[{"line_number":676,"context_line":"                                     \"fcd938702024c25fef6c32fef05298eb\"))"},{"line_number":677,"context_line":"            os.makedirs(os.path.join(tmpdir, \"sdq\", \"objects-99\", \"9972\","},{"line_number":678,"context_line":"                                     \"8eb\","},{"line_number":679,"context_line":"                                     \"fcd938702024c25fef6c32fef05298eb\"))"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"            # the bad"},{"line_number":682,"context_line":"            self._make_file(os.path.join(tmpdir, \"sdp\", \"objects\", \"1519\","}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_d9c26ee8","line":679,"updated":"2014-06-11 13:17:21.000000000","message":"nit: maybe test for warnings on bad dirs like \"object-\" and \"junk\"","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"9b03c955a4cd384347b223d483725a6a6069e318","unresolved":false,"context_lines":[{"line_number":676,"context_line":"                                     \"fcd938702024c25fef6c32fef05298eb\"))"},{"line_number":677,"context_line":"            os.makedirs(os.path.join(tmpdir, \"sdq\", \"objects-99\", \"9972\","},{"line_number":678,"context_line":"                                     \"8eb\","},{"line_number":679,"context_line":"                                     \"fcd938702024c25fef6c32fef05298eb\"))"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"            # the bad"},{"line_number":682,"context_line":"            self._make_file(os.path.join(tmpdir, \"sdp\", \"objects\", \"1519\","}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_e3d13858","line":679,"in_reply_to":"1ae5cdf2_d9c26ee8","updated":"2014-06-11 13:39:51.000000000","message":"agree, I think I did that in the same kinda code over in the auditor...","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0c996b0d3ef2979f25d4742b513e045b88ff74df","unresolved":false,"context_lines":[{"line_number":676,"context_line":"                                     \"fcd938702024c25fef6c32fef05298eb\"))"},{"line_number":677,"context_line":"            os.makedirs(os.path.join(tmpdir, \"sdq\", \"objects-99\", \"9972\","},{"line_number":678,"context_line":"                                     \"8eb\","},{"line_number":679,"context_line":"                                     \"fcd938702024c25fef6c32fef05298eb\"))"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"            # the bad"},{"line_number":682,"context_line":"            self._make_file(os.path.join(tmpdir, \"sdp\", \"objects\", \"1519\","}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_008b3f1f","line":679,"in_reply_to":"1ae5cdf2_e3d13858","updated":"2014-06-12 23:27:01.000000000","message":"Done","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"556e1f0798fca8ea7451a0c75a2a3e1c28eb1662","unresolved":false,"context_lines":[{"line_number":695,"context_line":"            os.makedirs(os.path.join(tmpdir, \"sdw\", \"containers\", \"28\", \"51e\","},{"line_number":696,"context_line":"                                     \"4f9eee668b66c6f0250bfa3c7ab9e51e\"))"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"            diskfile.logger \u003d mock_logger \u003d mock.MagicMock()"},{"line_number":699,"context_line":"            locations \u003d [(loc.path, loc.device, loc.partition)"},{"line_number":700,"context_line":"                         for loc in diskfile.object_audit_location_generator("},{"line_number":701,"context_line":"                             devices\u003dtmpdir, mount_check\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_59ae5e2f","line":698,"updated":"2014-06-11 13:17:21.000000000","message":"nit: \u0027diskfile.logger \u003d \u0027 not necessary","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0c996b0d3ef2979f25d4742b513e045b88ff74df","unresolved":false,"context_lines":[{"line_number":695,"context_line":"            os.makedirs(os.path.join(tmpdir, \"sdw\", \"containers\", \"28\", \"51e\","},{"line_number":696,"context_line":"                                     \"4f9eee668b66c6f0250bfa3c7ab9e51e\"))"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"            diskfile.logger \u003d mock_logger \u003d mock.MagicMock()"},{"line_number":699,"context_line":"            locations \u003d [(loc.path, loc.device, loc.partition)"},{"line_number":700,"context_line":"                         for loc in diskfile.object_audit_location_generator("},{"line_number":701,"context_line":"                             devices\u003dtmpdir, mount_check\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_858681b7","line":698,"in_reply_to":"1ae5cdf2_03f0e4fc","updated":"2014-06-12 23:27:01.000000000","message":"Done","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"9b03c955a4cd384347b223d483725a6a6069e318","unresolved":false,"context_lines":[{"line_number":695,"context_line":"            os.makedirs(os.path.join(tmpdir, \"sdw\", \"containers\", \"28\", \"51e\","},{"line_number":696,"context_line":"                                     \"4f9eee668b66c6f0250bfa3c7ab9e51e\"))"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"            diskfile.logger \u003d mock_logger \u003d mock.MagicMock()"},{"line_number":699,"context_line":"            locations \u003d [(loc.path, loc.device, loc.partition)"},{"line_number":700,"context_line":"                         for loc in diskfile.object_audit_location_generator("},{"line_number":701,"context_line":"                             devices\u003dtmpdir, mount_check\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_03f0e4fc","line":698,"in_reply_to":"1ae5cdf2_59ae5e2f","updated":"2014-06-11 13:39:51.000000000","message":"ah yes, it actually was in an earlier version but didn\u0027t back this out when it could have been.  nice catch","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"556e1f0798fca8ea7451a0c75a2a3e1c28eb1662","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                    (loc.path, loc.device, loc.partition)"},{"line_number":771,"context_line":"                    for loc in diskfile.object_audit_location_generator("},{"line_number":772,"context_line":"                        devices\u003dtmpdir, mount_check\u003dTrue,"},{"line_number":773,"context_line":"                        logger\u003dml)]"},{"line_number":774,"context_line":"                ml.debug.assert_called_once_with("},{"line_number":775,"context_line":"                    \u0027Skipping %s as it is not mounted\u0027,"},{"line_number":776,"context_line":"                    \u0027sdq\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_fda1d5f8","line":773,"updated":"2014-06-11 13:17:21.000000000","message":"nano-nit: line wrap crept in","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0c996b0d3ef2979f25d4742b513e045b88ff74df","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                    (loc.path, loc.device, loc.partition)"},{"line_number":771,"context_line":"                    for loc in diskfile.object_audit_location_generator("},{"line_number":772,"context_line":"                        devices\u003dtmpdir, mount_check\u003dTrue,"},{"line_number":773,"context_line":"                        logger\u003dml)]"},{"line_number":774,"context_line":"                ml.debug.assert_called_once_with("},{"line_number":775,"context_line":"                    \u0027Skipping %s as it is not mounted\u0027,"},{"line_number":776,"context_line":"                    \u0027sdq\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_4098e769","line":773,"in_reply_to":"1ae5cdf2_fda1d5f8","updated":"2014-06-12 23:27:01.000000000","message":"Done","commit_id":"09806c3a5d0161cb4d2d8b64394740f8815dc4be"}]}
