)]}'
{"karbor/api/v1/scheduled_operations.py":[{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"ebc2f883589677ff69749197c77f6909812ccb31","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                \u0027project_id\u0027: operation.get(\u0027project_id\u0027),"},{"line_number":54,"context_line":"                \u0027trigger_id\u0027: operation.get(\u0027trigger_id\u0027),"},{"line_number":55,"context_line":"                \u0027operation_definition\u0027: operation.get(\u0027operation_definition\u0027),"},{"line_number":56,"context_line":"                \u0027enabled\u0027: int(operation.get(\u0027enabled\u0027)),"},{"line_number":57,"context_line":"            }"},{"line_number":58,"context_line":"        }"},{"line_number":59,"context_line":"        state \u003d getattr(operation, \u0027state\u0027, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_a7b5d2ed","line":56,"range":{"start_line":56,"start_character":27,"end_line":56,"end_character":56},"updated":"2016-09-13 13:39:08.000000000","message":"Why int","commit_id":"5d4ddba1e7ed2df4e318a0e720ef404294458c97"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"513cd639a6b89e9e5cfe00bfb474e4c7ac76be4d","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                \u0027project_id\u0027: operation.get(\u0027project_id\u0027),"},{"line_number":54,"context_line":"                \u0027trigger_id\u0027: operation.get(\u0027trigger_id\u0027),"},{"line_number":55,"context_line":"                \u0027operation_definition\u0027: operation.get(\u0027operation_definition\u0027),"},{"line_number":56,"context_line":"                \u0027enabled\u0027: int(operation.get(\u0027enabled\u0027)),"},{"line_number":57,"context_line":"            }"},{"line_number":58,"context_line":"        }"},{"line_number":59,"context_line":"        state \u003d getattr(operation, \u0027state\u0027, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_27c15fe5","line":56,"range":{"start_line":56,"start_character":27,"end_line":56,"end_character":56},"in_reply_to":"9a89bdaa_a7b5d2ed","updated":"2016-09-14 07:57:39.000000000","message":"I want to keep it consistent with the \u0027enabled\u0027 parameter of \u0027update\u0027 api, whose type is integer.","commit_id":"5d4ddba1e7ed2df4e318a0e720ef404294458c97"}],"smaug/api/v1/scheduled_operations.py":[{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"4ae3b1748f9d69612dc983bacffd7f6e259f48ec","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            msg \u003d _(\u0027Only support updating of operation state\u0027)"},{"line_number":194,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        cur_state \u003d operation.state"},{"line_number":197,"context_line":"        if new_state \u003d\u003d cur_state:"},{"line_number":198,"context_line":"            msg \u003d _(\u0027The new state is same with current\u0027)"},{"line_number":199,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if (new_state \u003d\u003d constants.OPERATION_STATE_SUSPEND and ("},{"line_number":202,"context_line":"                cur_state !\u003d constants.OPERATION_STATE_DELETED)) or ("},{"line_number":203,"context_line":"                new_state \u003d\u003d constants.OPERATION_STATE_REGISTERED and ("},{"line_number":204,"context_line":"                cur_state \u003d\u003d constants.OPERATION_STATE_SUSPEND)):"},{"line_number":205,"context_line":"            self._update_scheduled_operation_state(context, id, new_state)"},{"line_number":206,"context_line":"        else:"},{"line_number":207,"context_line":"            msg \u003d (_(\u0027Can not update operation state, new state\u003d%(new_state)s,\u0027"},{"line_number":208,"context_line":"                     \u0027 current state\u003d%(cur_state)s\u0027) % {"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_9913c000","line":205,"range":{"start_line":196,"start_character":0,"end_line":205,"end_character":74},"updated":"2016-08-07 08:15:26.000000000","message":"1. why raise an exception? if the new state is the same, just ignore\n2. how about move all these conditions to _update_scheduled_operation_state() ?","commit_id":"7117395ef1fe3e3f431f38f057e3830945906bf6"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"471749c4bd6f2cd2edc50b373e99edc4cdc1de00","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            msg \u003d _(\u0027Only support updating of operation state\u0027)"},{"line_number":194,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        cur_state \u003d operation.state"},{"line_number":197,"context_line":"        if new_state \u003d\u003d cur_state:"},{"line_number":198,"context_line":"            msg \u003d _(\u0027The new state is same with current\u0027)"},{"line_number":199,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if (new_state \u003d\u003d constants.OPERATION_STATE_SUSPEND and ("},{"line_number":202,"context_line":"                cur_state !\u003d constants.OPERATION_STATE_DELETED)) or ("},{"line_number":203,"context_line":"                new_state \u003d\u003d constants.OPERATION_STATE_REGISTERED and ("},{"line_number":204,"context_line":"                cur_state \u003d\u003d constants.OPERATION_STATE_SUSPEND)):"},{"line_number":205,"context_line":"            self._update_scheduled_operation_state(context, id, new_state)"},{"line_number":206,"context_line":"        else:"},{"line_number":207,"context_line":"            msg \u003d (_(\u0027Can not update operation state, new state\u003d%(new_state)s,\u0027"},{"line_number":208,"context_line":"                     \u0027 current state\u003d%(cur_state)s\u0027) % {"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_fd83bdc8","line":205,"range":{"start_line":196,"start_character":0,"end_line":205,"end_character":74},"in_reply_to":"bacf61ea_9913c000","updated":"2016-08-08 07:11:19.000000000","message":"totally agree with you. The logic is clearer to move them to the function. thanks.","commit_id":"7117395ef1fe3e3f431f38f057e3830945906bf6"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"dcb0ca02f35a5142181e4de8d0831b745985c7b9","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        operation_info \u003d body[\u0027scheduled_operation\u0027]"},{"line_number":191,"context_line":"        new_state \u003d operation_info.get(\u0027state\u0027)"},{"line_number":192,"context_line":"        if not new_state or len(operation_info) !\u003d 1:"},{"line_number":193,"context_line":"            msg \u003d _(\u0027Only support updating of operation state\u0027)"},{"line_number":194,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        self._update_scheduled_operation_state("}],"source_content_type":"text/x-python","patch_set":5,"id":"9ad45d7e_2eca1da2","line":193,"range":{"start_line":192,"start_character":0,"end_line":193,"end_character":63},"updated":"2016-08-08 15:26:35.000000000","message":"Why can\u0027t we update other fields as well?","commit_id":"2880ffdc25b1f4a008a75d1ae995406de4ea97d6"},{"author":{"_account_id":18266,"name":"zengchen","email":"chenzeng2@huawei.com","username":"zengchen"},"change_message_id":"ca95a053400ceda97ca0cc57bc04a5b2cea04e94","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        operation_info \u003d body[\u0027scheduled_operation\u0027]"},{"line_number":191,"context_line":"        new_state \u003d operation_info.get(\u0027state\u0027)"},{"line_number":192,"context_line":"        if not new_state or len(operation_info) !\u003d 1:"},{"line_number":193,"context_line":"            msg \u003d _(\u0027Only support updating of operation state\u0027)"},{"line_number":194,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        self._update_scheduled_operation_state("}],"source_content_type":"text/x-python","patch_set":5,"id":"9ad45d7e_de9f9301","line":193,"range":{"start_line":192,"start_character":0,"end_line":193,"end_character":63},"in_reply_to":"9ad45d7e_2eca1da2","updated":"2016-08-09 04:20:27.000000000","message":"Sorry, actually, we don\u0027t have use cases to update other fields. \nIf we need , we should define which fields can be updated.\nBTW, I don\u0027t think it is a good choice to allow to update the \nstate of operation, because it is the internal information which\nuser can not update but only allow to show. Besides, it is hard\nto keep the sate consistent, because \u0027executor\u0027 will update it at\nthe beginning and ending of the execution of the operation . \nIf we want to suspend/resume the operation, it is a better way to\nadd a new filed named \u0027enable\u0027 to operation. If user want to\nsuspend it, set the \u0027enable\u0027 to \u0027False\u0027; and if resume it, set it \nback to \u0027True\u0027. It is simpler and will not confilct with field \n\u0027state\u0027. I want to implement it in this way, what\u0027s your opinion? \nthanks  very much for your comment! It make me think more about \nthis new api.","commit_id":"2880ffdc25b1f4a008a75d1ae995406de4ea97d6"},{"author":{"_account_id":2023,"name":"Saggi Mizrahi","email":"ficoos+osreview@gmail.com","username":"ficoos"},"change_message_id":"a7597a97cba07e8b5907381024cc5050229d5552","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        operation_info \u003d body[\u0027scheduled_operation\u0027]"},{"line_number":191,"context_line":"        new_state \u003d operation_info.get(\u0027state\u0027)"},{"line_number":192,"context_line":"        if not new_state or len(operation_info) !\u003d 1:"},{"line_number":193,"context_line":"            msg \u003d _(\u0027Only support updating of operation state\u0027)"},{"line_number":194,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        self._update_scheduled_operation_state("}],"source_content_type":"text/x-python","patch_set":5,"id":"1ac06dbe_bf4d509b","line":193,"range":{"start_line":192,"start_character":0,"end_line":193,"end_character":63},"in_reply_to":"9ad45d7e_de9f9301","updated":"2016-08-22 09:03:27.000000000","message":"As I said on IRC, we have use cases where we update the whole object. I would prefer that we use that instead of having a special use case for this unless we have to.","commit_id":"2880ffdc25b1f4a008a75d1ae995406de4ea97d6"}]}
