)]}'
{"climate/manager/service.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"85b1369105251229cdc5d694add014b5576b52c9","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    def __enter__(self):"},{"line_number":264,"context_line":"        pass"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def __exit__(self, type, value, traceback):"},{"line_number":267,"context_line":"        if type is not None and \\"},{"line_number":268,"context_line":"           self.lease_id is not None:"},{"line_number":269,"context_line":"            db_api.lease_destroy(self.lease_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2Fd4s%3D","line":266,"updated":"2014-01-13 15:49:59.000000000","message":"it\u0027s better to use not type, but some other naming not to intersect with build in python names.","commit_id":"4c65c61d843175f6fe491b72ea5d5629351b314c"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"124951c23aaf24f27959d7f36bfa0a85459ae70e","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    def __enter__(self):"},{"line_number":264,"context_line":"        pass"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def __exit__(self, type, value, traceback):"},{"line_number":267,"context_line":"        if type is not None and \\"},{"line_number":268,"context_line":"           self.lease_id is not None:"},{"line_number":269,"context_line":"            db_api.lease_destroy(self.lease_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2Fd2U%3D","line":266,"in_reply_to":"AAAAUH%2F%2Fd4s%3D","updated":"2014-01-13 15:53:33.000000000","message":"like exc_type, exc_value, ...","commit_id":"4c65c61d843175f6fe491b72ea5d5629351b314c"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"85b1369105251229cdc5d694add014b5576b52c9","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        pass"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def __exit__(self, type, value, traceback):"},{"line_number":267,"context_line":"        if type is not None and \\"},{"line_number":268,"context_line":"           self.lease_id is not None:"},{"line_number":269,"context_line":"            db_api.lease_destroy(self.lease_id)"},{"line_number":270,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2Fd48%3D","line":267,"updated":"2014-01-13 15:49:59.000000000","message":"that can be located on one line :)","commit_id":"4c65c61d843175f6fe491b72ea5d5629351b314c"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"7dc88b76e4dfc3e2888a2557df1cfe74766aed76","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                                       \u0027status\u0027: \u0027UNDONE\u0027})"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        transaction \u003d LeaseTransaction()"},{"line_number":180,"context_line":"        with transaction:"},{"line_number":181,"context_line":"            lease \u003d db_api.lease_create(lease_values)"},{"line_number":182,"context_line":"            transaction.set_lease_id(lease[\u0027id\u0027])"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FFbE%3D","line":180,"updated":"2014-01-17 16:15:33.000000000","message":"You can handle errors in a simple Try/Except/Finaly .. without this LeaseTransaction context. It will be much much readable.\n\nAnd more important : log the error and raise a NotFound/ClimateException to inform user. Currently if an error occurs, the lease and all reservations will be deleted BUT I guess It will raise a KeyError because of non existance of lease[\u0027id\u0027]","commit_id":"2debb68bc0ac70d912a9af33e17e67ab9674d622"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"7dc88b76e4dfc3e2888a2557df1cfe74766aed76","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                datetime.datetime.utcnow() \u003e lease[\u0027end_date\u0027]):"},{"line_number":205,"context_line":"            for reservation in lease[\u0027reservations\u0027]:"},{"line_number":206,"context_line":"                self.plugins[reservation[\u0027resource_type\u0027]]\\"},{"line_number":207,"context_line":"                    .on_end(reservation[\u0027resource_id\u0027])"},{"line_number":208,"context_line":"            db_api.lease_destroy(lease_id)"},{"line_number":209,"context_line":"        else:"},{"line_number":210,"context_line":"            raise exceptions.NotAuthorized("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FFUA%3D","line":207,"updated":"2014-01-17 16:15:33.000000000","message":"I\u0027ll be glad to see one try/except around on_end operation","commit_id":"2debb68bc0ac70d912a9af33e17e67ab9674d622"},{"author":{"_account_id":7075,"name":"Swann Croiset","email":"scroiset@mirantis.com","username":"swann"},"change_message_id":"7dc88b76e4dfc3e2888a2557df1cfe74766aed76","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        for reservation in lease[\u0027reservations\u0027]:"},{"line_number":225,"context_line":"            resource_type \u003d reservation[\u0027resource_type\u0027]"},{"line_number":226,"context_line":"            self.resource_actions[resource_type][action_time]("},{"line_number":227,"context_line":"                reservation[\u0027resource_id\u0027]"},{"line_number":228,"context_line":"            )"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"            if reservation_status is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FFTE%3D","line":227,"updated":"2014-01-17 16:15:33.000000000","message":"same here for action : try/except","commit_id":"2debb68bc0ac70d912a9af33e17e67ab9674d622"}]}
