)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"c19d9306b4e7377599933c6da75802558384dda4","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zengchen \u003cchenzeng2@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-03-27 11:52:50 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use TaskFlow correctly"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Ia0c7382808430e3d450c11b1d41b3719cef8fab9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ffe62b97_fe39e83e","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":22},"updated":"2017-03-27 08:48:58.000000000","message":"Choose a descriptive title for the commit","commit_id":"0892154fc7f9b154cc0983100da50333fa0cbf0b"}],"karbor/services/protection/protection_plugins/volume/cinder_protection_plugin.py":[{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"729e1e76ad9b3ddaed36686d43257c14e0a427a1","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    def __init__(self):"},{"line_number":253,"context_line":"        super(RestoreOperation, self).__init__()"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def on_main(self, checkpoint, resource, context, parameters, heat_template,"},{"line_number":256,"context_line":"                **kwargs):"},{"line_number":257,"context_line":"        resource_id \u003d resource.id"},{"line_number":258,"context_line":"        bank_section \u003d checkpoint.get_resource_bank_section(resource_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffe62b97_fdcfb57c","side":"PARENT","line":255,"range":{"start_line":255,"start_character":65,"end_line":255,"end_character":78},"updated":"2017-03-27 06:07:39.000000000","message":"why?","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"c19d9306b4e7377599933c6da75802558384dda4","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    def __init__(self):"},{"line_number":253,"context_line":"        super(RestoreOperation, self).__init__()"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def on_main(self, checkpoint, resource, context, parameters, heat_template,"},{"line_number":256,"context_line":"                **kwargs):"},{"line_number":257,"context_line":"        resource_id \u003d resource.id"},{"line_number":258,"context_line":"        bank_section \u003d checkpoint.get_resource_bank_section(resource_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffe62b97_beeec0b1","side":"PARENT","line":255,"range":{"start_line":255,"start_character":65,"end_line":255,"end_character":78},"in_reply_to":"ffe62b97_4fb944e7","updated":"2017-03-27 08:48:58.000000000","message":"ok","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"6008d848acb964a47790431c201a0981905229bd","unresolved":false,"context_lines":[{"line_number":252,"context_line":"    def __init__(self):"},{"line_number":253,"context_line":"        super(RestoreOperation, self).__init__()"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def on_main(self, checkpoint, resource, context, parameters, heat_template,"},{"line_number":256,"context_line":"                **kwargs):"},{"line_number":257,"context_line":"        resource_id \u003d resource.id"},{"line_number":258,"context_line":"        bank_section \u003d checkpoint.get_resource_bank_section(resource_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffe62b97_4fb944e7","side":"PARENT","line":255,"range":{"start_line":255,"start_character":65,"end_line":255,"end_character":78},"in_reply_to":"ffe62b97_fdcfb57c","updated":"2017-03-27 06:49:46.000000000","message":"The other two plugins(image/nova) has done correctly. There are two reasons. 1. The declaration of method is different from the Base class[1].\n2. From the implementation of TaskFlow, there are two ways to declare the required parameter. One is by position parameter of method which will be parsed automatically, like \u0027checkpoint\u0027/\u0027resource\u0027. The other one is by specifying the parameter \u0027requires\u0027 when invoke the __init__ of Task[2][3]. If using the second way, then \u0027kwargs\u0027 will involve other parameters which are not declared by first way, like \u0027heat_template.\u0027\n[1]https://github.com/openstack/karbor/blob/master/karbor/services/protection/protection_plugin.py#L46\n[2]https://github.com/openstack/taskflow/blob/master/taskflow/task.py#L125\n[3]https://github.com/openstack/karbor/blob/master/karbor/services/protection/resource_flow.py#L103","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"}],"karbor/services/protection/resource_flow.py":[{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"729e1e76ad9b3ddaed36686d43257c14e0a427a1","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            \u0027resource\u0027: resource,"},{"line_number":100,"context_line":"        }"},{"line_number":101,"context_line":"        requires \u003d list(injects)"},{"line_number":102,"context_line":"        requires.append(\u0027checkpoint\u0027)"},{"line_number":103,"context_line":"        requires.extend(OPERATION_EXTRA_ARGS.get(self.operation_type, []))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        task \u003d self.workflow_engine.create_task(method,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffe62b97_dde191fe","side":"PARENT","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":37},"updated":"2017-03-27 06:07:39.000000000","message":"why?","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"c19d9306b4e7377599933c6da75802558384dda4","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            \u0027resource\u0027: resource,"},{"line_number":100,"context_line":"        }"},{"line_number":101,"context_line":"        requires \u003d list(injects)"},{"line_number":102,"context_line":"        requires.append(\u0027checkpoint\u0027)"},{"line_number":103,"context_line":"        requires.extend(OPERATION_EXTRA_ARGS.get(self.operation_type, []))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        task \u003d self.workflow_engine.create_task(method,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffe62b97_fec68849","side":"PARENT","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":37},"in_reply_to":"ffe62b97_cfee74b3","updated":"2017-03-27 08:48:58.000000000","message":"This is to ensure that all future operations define this in their args.","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"6008d848acb964a47790431c201a0981905229bd","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            \u0027resource\u0027: resource,"},{"line_number":100,"context_line":"        }"},{"line_number":101,"context_line":"        requires \u003d list(injects)"},{"line_number":102,"context_line":"        requires.append(\u0027checkpoint\u0027)"},{"line_number":103,"context_line":"        requires.extend(OPERATION_EXTRA_ARGS.get(self.operation_type, []))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        task \u003d self.workflow_engine.create_task(method,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffe62b97_cfee74b3","side":"PARENT","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":37},"in_reply_to":"ffe62b97_dde191fe","updated":"2017-03-27 06:49:46.000000000","message":"All the methods of \u0027Operation\u0027 have declared the \u0027checkpoint\u0027 parameter. TaskFlow will get the required parameters by parsing the definition of method[1]. So it is no need to declare again.\n[1]https://github.com/openstack/taskflow/blob/master/taskflow/atom.py#L99","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"cc4962a73f98b99bc7451cbcf7cb2a8e8e250725","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            \u0027resource\u0027: resource,"},{"line_number":100,"context_line":"        }"},{"line_number":101,"context_line":"        requires \u003d list(injects)"},{"line_number":102,"context_line":"        requires.append(\u0027checkpoint\u0027)"},{"line_number":103,"context_line":"        requires.extend(OPERATION_EXTRA_ARGS.get(self.operation_type, []))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        task \u003d self.workflow_engine.create_task(method,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffe62b97_b2a12549","side":"PARENT","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":37},"in_reply_to":"ffe62b97_fec68849","updated":"2017-03-28 02:45:44.000000000","message":"IMO, it can\u0027t do that. The method can work even if it does not declare the \u0027checkpoint\u0027. Because all the keyword parameters will be passed by \u0027kwargs\u0027. All the future operations should keep the same definition of methods declared in base Operation class.","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"cefc0acdd6e2aaee6051342dbece746608e8badd","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            \u0027resource\u0027: resource,"},{"line_number":100,"context_line":"        }"},{"line_number":101,"context_line":"        requires \u003d list(injects)"},{"line_number":102,"context_line":"        requires.append(\u0027checkpoint\u0027)"},{"line_number":103,"context_line":"        requires.extend(OPERATION_EXTRA_ARGS.get(self.operation_type, []))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        task \u003d self.workflow_engine.create_task(method,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7ffa3b31_0da30402","side":"PARENT","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":37},"updated":"2017-04-20 10:18:48.000000000","message":"Still having an issue with this one. Operations should define it.","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"4c406de57e5398541d4098128aa3afbcb710cb5b","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            \u0027resource\u0027: resource,"},{"line_number":100,"context_line":"        }"},{"line_number":101,"context_line":"        requires \u003d list(injects)"},{"line_number":102,"context_line":"        requires.append(\u0027checkpoint\u0027)"},{"line_number":103,"context_line":"        requires.extend(OPERATION_EXTRA_ARGS.get(self.operation_type, []))"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        task \u003d self.workflow_engine.create_task(method,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7ffa3b31_7268241c","side":"PARENT","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":37},"in_reply_to":"7ffa3b31_0da30402","updated":"2017-04-20 11:20:53.000000000","message":"The class of Operation has defined that parameter for each interfaces.","commit_id":"9922b17660936f1510eff8b9f9ba69a25fc9de77"},{"author":{"_account_id":23630,"name":"Tovin Seven","email":"tovin07@gmail.com","username":"tovin07"},"change_message_id":"e693a034aba3cf8095006e1ee2e5317aabe6bf87","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            \u0027parameters\u0027: parameters,"},{"line_number":99,"context_line":"            \u0027resource\u0027: resource,"},{"line_number":100,"context_line":"        }"},{"line_number":101,"context_line":"        requires \u003d OPERATION_EXTRA_ARGS.get(self.operation_type, None)"},{"line_number":102,"context_line":"        task \u003d self.workflow_engine.create_task(method,"},{"line_number":103,"context_line":"                                                name\u003dtask_name,"},{"line_number":104,"context_line":"                                                inject\u003dinjects,"}],"source_content_type":"text/x-python","patch_set":7,"id":"df140735_b5e040ce","line":101,"range":{"start_line":101,"start_character":65,"end_line":101,"end_character":70},"updated":"2017-05-31 03:29:29.000000000","message":"no need to specify None here","commit_id":"2eb15b3dd8897b57d7acc4decbf280f5f51842d0"}]}
