)]}'
{"cinder/utils.py":[{"author":{"_account_id":17718,"name":"Lallana","email":"gaozhiqiang2@huawei.com","username":"Lallana"},"change_message_id":"6a040169ea051bb603d847f11a64c50354d0ee4b","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        offset \u003d int(offset)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    rightnow \u003d timeutils.utcnow()"},{"line_number":272,"context_line":"    if unit not in (\u0027month\u0027, \u0027day\u0027, \u0027year\u0027, \u0027hour\u0027):"},{"line_number":273,"context_line":"        raise ValueError(\u0027Time period must be hour, day, month or year\u0027)"},{"line_number":274,"context_line":"    if unit \u003d\u003d \u0027month\u0027:"},{"line_number":275,"context_line":"        if offset \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_23a7cc50","line":272,"updated":"2015-09-02 09:32:20.000000000","message":"Maybe you can add \"but corrent period is XXX\" at the end of the sentence.","commit_id":"7ac01fb990c9f3f9c2d2b360d36bffa09a60620b"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"be929c87222a2c048ebe53d2df0a92554d6533f3","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        offset \u003d int(offset)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    rightnow \u003d timeutils.utcnow()"},{"line_number":272,"context_line":"    if unit not in (\u0027month\u0027, \u0027day\u0027, \u0027year\u0027, \u0027hour\u0027):"},{"line_number":273,"context_line":"        raise ValueError(\u0027Time period must be hour, day, month or year\u0027)"},{"line_number":274,"context_line":"    if unit \u003d\u003d \u0027month\u0027:"},{"line_number":275,"context_line":"        if offset \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_c6305e0a","line":272,"in_reply_to":"da20952f_23a7cc50","updated":"2015-09-03 15:48:47.000000000","message":"Not in the scope of this patch.","commit_id":"7ac01fb990c9f3f9c2d2b360d36bffa09a60620b"}],"cinder/volume/manager.py":[{"author":{"_account_id":17718,"name":"Lallana","email":"gaozhiqiang2@huawei.com","username":"Lallana"},"change_message_id":"093a54ef0400a8b6a92541a5114dccf5a87d48f9","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            project_id \u003d context.project_id"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"        if volume_ref[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":500,"context_line":"            # Volume is still attached, need to detach first"},{"line_number":501,"context_line":"            raise exception.VolumeAttached(volume_id\u003dvolume_id)"},{"line_number":502,"context_line":"        if vol_utils.extract_host(volume_ref[\u0027host\u0027]) !\u003d self.host:"},{"line_number":503,"context_line":"            raise exception.InvalidVolume("}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_9cea800e","line":500,"updated":"2015-08-28 09:48:28.000000000","message":"You should change the variable name from volume_id to another name. So that we can more easily find which \"volume_id\" is the value.","commit_id":"203e2887c825fd8b0ad000a09fa16877e59b3723"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"7f7f13f1b6fe6f2fb2594f099739db0ef62c858d","unresolved":false,"context_lines":[{"line_number":711,"context_line":"                 resource\u003dsnapshot)"},{"line_number":712,"context_line":"        return snapshot.id"},{"line_number":713,"context_line":""},{"line_number":714,"context_line":"    @utils.synchronized(\u0027{snapshot.id}-{f_name}\u0027, external\u003dTrue)"},{"line_number":715,"context_line":"    def delete_snapshot(self, context, snapshot, unmanage_only\u003dFalse):"},{"line_number":716,"context_line":"        \"\"\"Deletes and unexports snapshot.\"\"\""},{"line_number":717,"context_line":"        context \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_49395ff1","line":714,"updated":"2015-09-16 17:51:13.000000000","message":"@Eric so in your opinion each function that need a lock, should have a separate decorator, that will be used once in entire code base and specifying lock name somewhere inside it? I don\u0027t see how it\u0027s less complicated.\nAbout readability - python string formatting is pretty easy to read. \n\nSo please compare\n\n def locked_volume_operation(f):\n    \"\"\"...\"\"\"\n    def lvo_inner1(inst, context, volume_id, **kwargs):\n        @utils.synchronized(\"%s-%s\" % (volume_id, f.__name__), external\u003dTrue)\n        def lvo_inner2(*_args, **_kwargs):\n            return f(*_args, **_kwargs)\n        return lvo_inner2(inst, context, volume_id, **kwargs)\n    return lvo_inner1\n ...\n @locked_volume_operation\n def delete_volume(...)\n\nand\n\n @utils.synchronized(\u0027{volume_id}-{f_name}\u0027, external\u003dTrue)\n def delete_volume(...)","commit_id":"9e688d3e1ab37a2d37855b9594c86cd984d43f8c"}]}
