)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     cmart \u003cchristian.martinez@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-04-23 19:07:26 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"API Support for before_end param configuration"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adding the possibility to modify the before_end_lease event"},{"line_number":10,"context_line":"through the API rest by adding a new parameter on the JSON request called"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAAXH%2F%2FILg%3D","line":7,"updated":"2014-04-23 20:40:35.000000000","message":"I would say:\nExtending API to support lease modifications for before_end event","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Adding the possibility to modify the before_end_lease event"},{"line_number":10,"context_line":"through the API rest by adding a new parameter on the JSON request called"},{"line_number":11,"context_line":"\"before_end_notification\"."},{"line_number":12,"context_line":"The change made was implemented for both API versions and it affects both"},{"line_number":13,"context_line":"create lease and update lease operations"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Partially implements: blueprint before-end-notification-crud"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAAXH%2F%2FILo%3D","line":12,"updated":"2014-04-23 20:40:35.000000000","message":"\"made\" should be removed.","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"da5d003fcf06b02c1aa0e1680d260f0a5dc296d0","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Adding the possibility to modify the before_end_lease event"},{"line_number":10,"context_line":"through the API rest by adding a new parameter on the JSON request called"},{"line_number":11,"context_line":"\"before_end_notification\"."},{"line_number":12,"context_line":"The change made was implemented for both API versions and it affects both"},{"line_number":13,"context_line":"create lease and update lease operations"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Partially implements: blueprint before-end-notification-crud"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAAXX%2F%2F5KE%3D","line":12,"updated":"2014-04-25 13:45:31.000000000","message":"the word \"made\" should be removed","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"08eb0ad19a1aa6e3a4c173fb322fd1068e1b4b58","unresolved":false,"context_lines":[{"line_number":7,"context_line":"V2 API Support for before_end param configuration"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adding the possibility to modify the before_end_lease event"},{"line_number":10,"context_line":"through the API rest by adding a new parameter on the JSON request called"},{"line_number":11,"context_line":"\"before_end_notification\"."},{"line_number":12,"context_line":"The change was implemented for v2 API version and it affects both"},{"line_number":13,"context_line":"create lease and update lease operations"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"AAAAXX%2F%2FtW8%3D","line":10,"updated":"2014-04-28 14:55:46.000000000","message":"s/API rest/REST API/","commit_id":"e91c3d32114e5f5e7b06941fbc3a620adfefda3d"}],"climate/api/v1/service.py":[{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    @policy.authorize(\u0027leases\u0027, \u0027update\u0027)"},{"line_number":67,"context_line":"    def update_lease(self, lease_id, data):"},{"line_number":68,"context_line":"        \"\"\"Update lease. Name changing, prolonging and reducing lease and"},{"line_number":69,"context_line":"        ending notifications may be proceeded."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        :param lease_id: ID of the lease in Climate DB."},{"line_number":72,"context_line":"        :type lease_id: str"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FIKU%3D","line":69,"updated":"2014-04-23 20:40:35.000000000","message":"I would change this to: \n... and changing before end notification","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        if data:"},{"line_number":82,"context_line":"            raise exceptions.ClimateException(\u0027Only name changing, \u0027"},{"line_number":83,"context_line":"                                              \u0027dates and notifications may be \u0027"},{"line_number":84,"context_line":"                                              \u0027proceeded.\u0027)"},{"line_number":85,"context_line":"        data \u003d {}"},{"line_number":86,"context_line":"        if new_name:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FIJ0%3D","line":83,"updated":"2014-04-23 20:40:35.000000000","message":"I would say: \"and before end notifications\"","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d1735cb0e8c97aa7b21d8f7e7e71313922c6a40","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @policy.authorize(\u0027leases\u0027, \u0027update\u0027)"},{"line_number":67,"context_line":"    def update_lease(self, lease_id, data):"},{"line_number":68,"context_line":"        \"\"\"Update lease. Name changing, prolonging and reducing lease and"},{"line_number":69,"context_line":"        ending notifications may be proceeded."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        :param lease_id: ID of the lease in Climate DB."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FEeY%3D","line":68,"updated":"2014-04-24 08:59:31.000000000","message":"nit, please remove the first \u0027and\u0027","commit_id":"f10ae01f508f639530a12cafa5ae4e5ec7a30fa0"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"03e6a274e63b6596f07705cd6fa637849cc223b9","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return self.manager_rpcapi.get_lease(lease_id)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @policy.authorize(\u0027leases\u0027, \u0027update\u0027)"},{"line_number":67,"context_line":"    def update_lease(self, lease_id, data):"},{"line_number":68,"context_line":"        \"\"\"Update lease. Name changing, prolonging, reducing lease and"},{"line_number":69,"context_line":"        changing before end notification may be proceeded."},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F6Uo%3D","line":67,"updated":"2014-04-25 11:11:41.000000000","message":"Personally I don\u0027t like the idea of modifying the API v1, as it\u0027s stable and I don\u0027t like new features in it - let\u0027s support it and provide bug fixes (if found), but no new features - for the purpose we have v2.","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"6b2f6be6bc9976b5a6b4c019cc11fb5f6f1d4c2d","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        return self.manager_rpcapi.get_lease(lease_id)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @policy.authorize(\u0027leases\u0027, \u0027update\u0027)"},{"line_number":67,"context_line":"    def update_lease(self, lease_id, data):"},{"line_number":68,"context_line":"        \"\"\"Update lease. Name changing, prolonging, reducing lease and"},{"line_number":69,"context_line":"        changing before end notification may be proceeded."},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5qU%3D","line":67,"in_reply_to":"AAAAXX%2F%2F6Uo%3D","updated":"2014-04-25 13:00:19.000000000","message":"OK so, what you\u0027re saying is that we should support this new parameter on V1 but not new features.. How can I accomplish that? I mean, if I don´t put this code in this file, the update_lease method will explode when the request has the before_end_notification. What are your thoughts around this?","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"}],"climate/api/v2/controllers/lease.py":[{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        if sublease_dct !\u003d {}:"},{"line_number":134,"context_line":"            raise exceptions.ClimateException(\u0027Only name changing, \u0027"},{"line_number":135,"context_line":"                                              \u0027dates and notifications may be \u0027"},{"line_number":136,"context_line":"                                              \u0027proceeded.\u0027)"},{"line_number":137,"context_line":"        if new_name:"},{"line_number":138,"context_line":"            sublease_dct[\u0027name\u0027] \u003d new_name"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FIIQ%3D","line":135,"updated":"2014-04-23 20:40:35.000000000","message":"I would change the message to: \"... and before end notifications\"","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d1735cb0e8c97aa7b21d8f7e7e71313922c6a40","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    \"The list of reservations belonging to the lease\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    events \u003d wtypes.ArrayType(wtypes.DictType(wtypes.text, wtypes.text))"},{"line_number":57,"context_line":"    \"The list of events attached to the lease\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @classmethod"},{"line_number":60,"context_line":"    def sample(cls):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FEY8%3D","line":57,"updated":"2014-04-24 08:59:31.000000000","message":"before_end_notification WSME type is missing here","commit_id":"f10ae01f508f639530a12cafa5ae4e5ec7a30fa0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d1735cb0e8c97aa7b21d8f7e7e71313922c6a40","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def sample(cls):"},{"line_number":61,"context_line":"        return cls(id\u003du\u00272bb8720a-0873-4d97-babf-0d906851a1eb\u0027,"},{"line_number":62,"context_line":"                   name\u003du\u0027lease_test\u0027,"},{"line_number":63,"context_line":"                   start_date\u003du\u00272014-01-01 01:23\u0027,"},{"line_number":64,"context_line":"                   end_date\u003du\u00272014-02-01 13:37\u0027,"},{"line_number":65,"context_line":"                   user_id\u003du\u0027efd87807-12d2-4b38-9c70-5f5c2ac427ff\u0027,"},{"line_number":66,"context_line":"                   project_id\u003du\u0027bd9431c1-8d69-4ad3-803a-8d4a6b89fd36\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FEY4%3D","line":63,"updated":"2014-04-24 08:59:31.000000000","message":"before_end_notification WSME type is missing here","commit_id":"f10ae01f508f639530a12cafa5ae4e5ec7a30fa0"}],"climate/manager/service.py":[{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"2c7b0c17665adabc99860c03af7dd21a7c559b1f","unresolved":false,"context_lines":[{"line_number":446,"context_line":"            # NOTE(casanch1) do nothing if the event does not exist."},{"line_number":447,"context_line":"            # This is for backward compatibility"},{"line_number":448,"context_line":"            delta \u003d old_lease[\u0027end_date\u0027]"},{"line_number":449,"context_line":"            if (before_end_time):"},{"line_number":450,"context_line":"                try:"},{"line_number":451,"context_line":"                    before_end_time \u003d self._date_from_string(before_end_time)"},{"line_number":452,"context_line":"                except Exception as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXH%2F%2FLY0%3D","line":449,"updated":"2014-04-23 14:40:39.000000000","message":"Remove the ()","commit_id":"8c4826376d929303386e6be258ef8e179a992ca6"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":229,"context_line":"            new_before_end_date \u003d lease_values[\u0027end_date\u0027] - delta"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"            self._update_before_end_event_date(event, new_before_end_date,"},{"line_number":232,"context_line":"                                               lease_values)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        try:"},{"line_number":235,"context_line":"            lease \u003d db_api.lease_create(lease_values)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FIHI%3D","line":232,"updated":"2014-04-23 20:40:35.000000000","message":"This block can be refactored so the repeated lines: 217-226, 219-228, 221-232 are outside of the if/elif block.","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"0f3b338b8f463c209b90eb8cd80b634ba4ffd896","unresolved":false,"context_lines":[{"line_number":229,"context_line":"            new_before_end_date \u003d lease_values[\u0027end_date\u0027] - delta"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"            self._update_before_end_event_date(event, new_before_end_date,"},{"line_number":232,"context_line":"                                               lease_values)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        try:"},{"line_number":235,"context_line":"            lease \u003d db_api.lease_create(lease_values)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FHwg%3D","line":232,"in_reply_to":"AAAAXH%2F%2FH14%3D","updated":"2014-04-23 21:01:09.000000000","message":"Makes sense?\n\n        before_end_date \u003d lease_values.get(\u0027before_end_notification\u0027, None)\n        if before_end_date:\n            before_end_date \u003d self._date_from_string(before_end_date)\n        elif CONF.manager.notify_hours_before_lease_end \u003e 0:\n            delta \u003d datetime.timedelta(hours\u003dCONF.manager.notify_hours_before_lease_end)\n            before_end_date \u003d lease_values[\u0027end_date\u0027] - delta\n\n        if before_end_date:\n   \t    event \u003d {\u0027event_type\u0027: \u0027before_end_lease\u0027,\n\t                  \u0027status\u0027: \u0027UNDONE\u0027}\n\t    lease_values[\u0027events\u0027].append(event)\n            self._update_before_end_event_date(event, new_before_end_date, lease_values)","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"46d796d74fb598582286561f5c3e06dd25e7c313","unresolved":false,"context_lines":[{"line_number":229,"context_line":"            new_before_end_date \u003d lease_values[\u0027end_date\u0027] - delta"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"            self._update_before_end_event_date(event, new_before_end_date,"},{"line_number":232,"context_line":"                                               lease_values)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        try:"},{"line_number":235,"context_line":"            lease \u003d db_api.lease_create(lease_values)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FH14%3D","line":232,"in_reply_to":"AAAAXH%2F%2FIHI%3D","updated":"2014-04-23 20:49:14.000000000","message":"Could you please tell me how? Thanks","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    def _update_before_end_event_date(self, event, new_date, lease):"},{"line_number":431,"context_line":"        event[\u0027time\u0027] \u003d new_date"},{"line_number":432,"context_line":"        if event[\u0027time\u0027] \u003e lease[\u0027end_date\u0027]:"},{"line_number":433,"context_line":"            raise common_ex.NotAuthorized("},{"line_number":434,"context_line":"                \u0027Before end date must be earlier than end date\u0027)"},{"line_number":435,"context_line":"        if event[\u0027time\u0027] \u003c lease[\u0027start_date\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FH9U%3D","line":432,"updated":"2014-04-23 20:40:35.000000000","message":"I think this validation should be done in the update method. \n\nMoreover, I think it should be validated that before_end_date is inside the range of [start_date,  end_date] when the value for before_end_date is provided. \n\nBut, if the configuration parameter is used to calculate the before_end_date, then it should\u0027t be validated and just put the same date as start_date when the value is out of the range.\n\nI hope I\u0027m clear :)","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":436,"context_line":"            event[\u0027time\u0027] \u003d lease[\u0027start_date\u0027]"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def _update_before_end_event(self, old_lease, new_lease,"},{"line_number":439,"context_line":"                                 notifications, before_end_time):"},{"line_number":440,"context_line":"        event \u003d db_api.event_get_first_sorted_by_filters("},{"line_number":441,"context_line":"            \u0027lease_id\u0027,"},{"line_number":442,"context_line":"            \u0027asc\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FIAo%3D","line":439,"updated":"2014-04-23 20:40:35.000000000","message":"I would call the argument before_end_date","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"06880f7bd726f56c10684b656d8cb9921fa162ee","unresolved":false,"context_lines":[{"line_number":457,"context_line":"                    # check before_end_time limits"},{"line_number":458,"context_line":"                    if new_lease[\u0027start_date\u0027] \u003e before_end_time:"},{"line_number":459,"context_line":"                        before_end_time \u003d new_lease[\u0027start_date\u0027]"},{"line_number":460,"context_line":"                    if new_lease[\u0027end_date\u0027] \u003c before_end_time:"},{"line_number":461,"context_line":"                        raise common_ex.NotAuthorized("},{"line_number":462,"context_line":"                            \u0027Before end date must be earlier than end date\u0027)"},{"line_number":463,"context_line":"                    self._update_before_end_event_date(update_values,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FH60%3D","line":460,"updated":"2014-04-23 20:40:35.000000000","message":"I think this validation should be done in the update method","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"778d490e79f94b87c9e997ee432f04c64d006b9f","unresolved":false,"context_lines":[{"line_number":428,"context_line":"                                                     \u0027lease.%s\u0027 % event)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    def _update_before_end_event_date(self, event, new_date, lease):"},{"line_number":431,"context_line":"        event[\u0027time\u0027] \u003d new_date"},{"line_number":432,"context_line":"        if event[\u0027time\u0027] \u003e lease[\u0027end_date\u0027]:"},{"line_number":433,"context_line":"            raise common_ex.NotAuthorized("},{"line_number":434,"context_line":"                \u0027Before end date must be earlier than end date\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FENE%3D","line":431,"updated":"2014-04-24 09:17:11.000000000","message":"I\u0027m just wondering if we could take use of https://github.com/stackforge/climate/blob/master/climate/openstack/common/timeutils.py","commit_id":"f10ae01f508f639530a12cafa5ae4e5ec7a30fa0"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d1735cb0e8c97aa7b21d8f7e7e71313922c6a40","unresolved":false,"context_lines":[{"line_number":431,"context_line":"        event[\u0027time\u0027] \u003d new_date"},{"line_number":432,"context_line":"        if event[\u0027time\u0027] \u003e lease[\u0027end_date\u0027]:"},{"line_number":433,"context_line":"            raise common_ex.NotAuthorized("},{"line_number":434,"context_line":"                \u0027Before end date must be earlier than end date\u0027)"},{"line_number":435,"context_line":"        if event[\u0027time\u0027] \u003c lease[\u0027start_date\u0027]:"},{"line_number":436,"context_line":"            event[\u0027time\u0027] \u003d lease[\u0027start_date\u0027]"},{"line_number":437,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FEc0%3D","line":434,"updated":"2014-04-24 08:59:31.000000000","message":"should it be before_end_date ?","commit_id":"f10ae01f508f639530a12cafa5ae4e5ec7a30fa0"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"98a49f87a2ebcf9b5da72f12e12c6c4ea9da912e","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                    before_end_date)"},{"line_number":221,"context_line":"                self.check_date_within_lease_limits(before_end_date,"},{"line_number":222,"context_line":"                                                    lease_values)"},{"line_number":223,"context_line":"            except Exception as e:"},{"line_number":224,"context_line":"                LOG.error(\"Invalid before_end_date param. %s\" % e.message)"},{"line_number":225,"context_line":"                raise e"},{"line_number":226,"context_line":"        elif CONF.manager.notify_hours_before_lease_end \u003e 0:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F%2FFQ%3D","line":223,"updated":"2014-04-24 21:22:39.000000000","message":"I think would be better to catch ClimateException","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"6b2f6be6bc9976b5a6b4c019cc11fb5f6f1d4c2d","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                    before_end_date)"},{"line_number":221,"context_line":"                self.check_date_within_lease_limits(before_end_date,"},{"line_number":222,"context_line":"                                                    lease_values)"},{"line_number":223,"context_line":"            except Exception as e:"},{"line_number":224,"context_line":"                LOG.error(\"Invalid before_end_date param. %s\" % e.message)"},{"line_number":225,"context_line":"                raise e"},{"line_number":226,"context_line":"        elif CONF.manager.notify_hours_before_lease_end \u003e 0:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5ps%3D","line":223,"in_reply_to":"AAAAXX%2F%2F%2FFQ%3D","updated":"2014-04-25 13:00:19.000000000","message":"The thing here is that we could have multiple exceptions coming from the try block. For instance, _date_from_string could throw an InvalidDate exception and check_date_within_lease_limits could throw a NotAuthorized exception.\nIf you want, I could add two except blocks to handle that exceptions, but the blocks contents will be the same.","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"90f1a0b2b7f5a9e55d3155b4fc8760285ad40b78","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                hours\u003dCONF.manager.notify_hours_before_lease_end)"},{"line_number":229,"context_line":"            before_end_date \u003d lease_values[\u0027end_date\u0027] - delta"},{"line_number":230,"context_line":"            if before_end_date \u003c lease_values[\u0027start_date\u0027]:"},{"line_number":231,"context_line":"                LOG.info(\"start_date greater than before_end_date. \""},{"line_number":232,"context_line":"                         \"Setting before_end_date to: %s\" % start_date)"},{"line_number":233,"context_line":"                before_end_date \u003d start_date"},{"line_number":234,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F%2B14%3D","line":231,"updated":"2014-04-24 21:20:59.000000000","message":"I don\u0027t think logging this is necessary","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"6b2f6be6bc9976b5a6b4c019cc11fb5f6f1d4c2d","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                hours\u003dCONF.manager.notify_hours_before_lease_end)"},{"line_number":229,"context_line":"            before_end_date \u003d lease_values[\u0027end_date\u0027] - delta"},{"line_number":230,"context_line":"            if before_end_date \u003c lease_values[\u0027start_date\u0027]:"},{"line_number":231,"context_line":"                LOG.info(\"start_date greater than before_end_date. \""},{"line_number":232,"context_line":"                         \"Setting before_end_date to: %s\" % start_date)"},{"line_number":233,"context_line":"                before_end_date \u003d start_date"},{"line_number":234,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5oU%3D","line":231,"in_reply_to":"AAAAXX%2F%2F%2B14%3D","updated":"2014-04-25 13:00:19.000000000","message":"I think that it is because setting the before_date to a non-expected value needs to be, at least, logged just for information.\nIf an admin doesn´t know about the inner configuration and gets the before_end equal to the start date, it could think that it\u0027s a bug or broken functionality.","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"90f1a0b2b7f5a9e55d3155b4fc8760285ad40b78","unresolved":false,"context_lines":[{"line_number":358,"context_line":"        db_api.event_update(event[\u0027id\u0027], {\u0027time\u0027: values[\u0027end_date\u0027]})"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        notifications \u003d [\u0027update\u0027]"},{"line_number":361,"context_line":"        before_end_date \u003d values.get(\u0027before_end_notification\u0027, None)"},{"line_number":362,"context_line":"        if (before_end_date):"},{"line_number":363,"context_line":"            try:"},{"line_number":364,"context_line":"                before_end_date \u003d self._date_from_string("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F%2By8%3D","line":361,"updated":"2014-04-24 21:20:59.000000000","message":"I think before_end_date should be managed in the same way of the rest of the dates. Please see lines 297 to 304. Then, I think it\u0027ll be clearer to have the validation rule right below the other validations, please see lines 306 to 323","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"6b2f6be6bc9976b5a6b4c019cc11fb5f6f1d4c2d","unresolved":false,"context_lines":[{"line_number":358,"context_line":"        db_api.event_update(event[\u0027id\u0027], {\u0027time\u0027: values[\u0027end_date\u0027]})"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        notifications \u003d [\u0027update\u0027]"},{"line_number":361,"context_line":"        before_end_date \u003d values.get(\u0027before_end_notification\u0027, None)"},{"line_number":362,"context_line":"        if (before_end_date):"},{"line_number":363,"context_line":"            try:"},{"line_number":364,"context_line":"                before_end_date \u003d self._date_from_string("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5mA%3D","line":361,"in_reply_to":"AAAAXX%2F%2F%2By8%3D","updated":"2014-04-25 13:00:19.000000000","message":"Agree with the validation rule right below other validations.\nNot so sure about the first phrase. Are you talking about the \"None\" on the get call?","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"da5d003fcf06b02c1aa0e1680d260f0a5dc296d0","unresolved":false,"context_lines":[{"line_number":358,"context_line":"        db_api.event_update(event[\u0027id\u0027], {\u0027time\u0027: values[\u0027end_date\u0027]})"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        notifications \u003d [\u0027update\u0027]"},{"line_number":361,"context_line":"        before_end_date \u003d values.get(\u0027before_end_notification\u0027, None)"},{"line_number":362,"context_line":"        if (before_end_date):"},{"line_number":363,"context_line":"            try:"},{"line_number":364,"context_line":"                before_end_date \u003d self._date_from_string("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5LE%3D","line":361,"in_reply_to":"AAAAXX%2F%2F5P4%3D","updated":"2014-04-25 13:45:31.000000000","message":"I ment that it might be better to move your lines around 364 to lines 301~304. So dates are all handled, validated, etc in the same place","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"5fb3b63f407973c8594ae5415066e41339374aa1","unresolved":false,"context_lines":[{"line_number":358,"context_line":"        db_api.event_update(event[\u0027id\u0027], {\u0027time\u0027: values[\u0027end_date\u0027]})"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        notifications \u003d [\u0027update\u0027]"},{"line_number":361,"context_line":"        before_end_date \u003d values.get(\u0027before_end_notification\u0027, None)"},{"line_number":362,"context_line":"        if (before_end_date):"},{"line_number":363,"context_line":"            try:"},{"line_number":364,"context_line":"                before_end_date \u003d self._date_from_string("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5P4%3D","line":361,"in_reply_to":"AAAAXX%2F%2F5g8%3D","updated":"2014-04-25 13:36:50.000000000","message":"The line 301 is equal to what I have on the L364.\nRegarding the L303-L304, that assignation is being made inside the _update_before_end_event. I\u0027ll submit a new patch with a different approach so you can tell me what are your thoughts about it. Thanks!","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"7e452db1c082f153051ee080bddcc522eb7acfe8","unresolved":false,"context_lines":[{"line_number":358,"context_line":"        db_api.event_update(event[\u0027id\u0027], {\u0027time\u0027: values[\u0027end_date\u0027]})"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        notifications \u003d [\u0027update\u0027]"},{"line_number":361,"context_line":"        before_end_date \u003d values.get(\u0027before_end_notification\u0027, None)"},{"line_number":362,"context_line":"        if (before_end_date):"},{"line_number":363,"context_line":"            try:"},{"line_number":364,"context_line":"                before_end_date \u003d self._date_from_string("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5g8%3D","line":361,"in_reply_to":"AAAAXX%2F%2F5mA%3D","updated":"2014-04-25 13:10:07.000000000","message":"For the first sentence, I\u0027m talking about lines 301 to 304.","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"98a49f87a2ebcf9b5da72f12e12c6c4ea9da912e","unresolved":false,"context_lines":[{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        notifications \u003d [\u0027update\u0027]"},{"line_number":361,"context_line":"        before_end_date \u003d values.get(\u0027before_end_notification\u0027, None)"},{"line_number":362,"context_line":"        if (before_end_date):"},{"line_number":363,"context_line":"            try:"},{"line_number":364,"context_line":"                before_end_date \u003d self._date_from_string("},{"line_number":365,"context_line":"                    before_end_date)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F%2B2Q%3D","line":362,"updated":"2014-04-24 21:22:39.000000000","message":"Please remove the ()","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"6b2f6be6bc9976b5a6b4c019cc11fb5f6f1d4c2d","unresolved":false,"context_lines":[{"line_number":359,"context_line":""},{"line_number":360,"context_line":"        notifications \u003d [\u0027update\u0027]"},{"line_number":361,"context_line":"        before_end_date \u003d values.get(\u0027before_end_notification\u0027, None)"},{"line_number":362,"context_line":"        if (before_end_date):"},{"line_number":363,"context_line":"            try:"},{"line_number":364,"context_line":"                before_end_date \u003d self._date_from_string("},{"line_number":365,"context_line":"                    before_end_date)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5oA%3D","line":362,"in_reply_to":"AAAAXX%2F%2F%2B2Q%3D","updated":"2014-04-25 13:00:19.000000000","message":"OK! (Sorry, bad javascript habit)","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"98a49f87a2ebcf9b5da72f12e12c6c4ea9da912e","unresolved":false,"context_lines":[{"line_number":364,"context_line":"                before_end_date \u003d self._date_from_string("},{"line_number":365,"context_line":"                    before_end_date)"},{"line_number":366,"context_line":"                self.check_date_within_lease_limits(before_end_date, values)"},{"line_number":367,"context_line":"            except Exception as e:"},{"line_number":368,"context_line":"                LOG.error(\"Invalid before_end_date param. %s\" % e.message)"},{"line_number":369,"context_line":"                raise e"},{"line_number":370,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F%2B2E%3D","line":367,"updated":"2014-04-24 21:22:39.000000000","message":"I think would be better to catch ClimateException","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"98a49f87a2ebcf9b5da72f12e12c6c4ea9da912e","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            notification_api.send_lease_notification(ctx, payload,"},{"line_number":444,"context_line":"                                                     \u0027lease.%s\u0027 % event)"},{"line_number":445,"context_line":""},{"line_number":446,"context_line":"    def check_date_within_lease_limits(self, date, lease):"},{"line_number":447,"context_line":"        if not lease[\u0027start_date\u0027] \u003c date \u003c lease[\u0027end_date\u0027]:"},{"line_number":448,"context_line":"            raise common_ex.NotAuthorized("},{"line_number":449,"context_line":"                \u0027Datetime is out of lease limits\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F%2FGg%3D","line":446,"updated":"2014-04-24 21:22:39.000000000","message":"Please add an underscore to this method","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"6b2f6be6bc9976b5a6b4c019cc11fb5f6f1d4c2d","unresolved":false,"context_lines":[{"line_number":443,"context_line":"            notification_api.send_lease_notification(ctx, payload,"},{"line_number":444,"context_line":"                                                     \u0027lease.%s\u0027 % event)"},{"line_number":445,"context_line":""},{"line_number":446,"context_line":"    def check_date_within_lease_limits(self, date, lease):"},{"line_number":447,"context_line":"        if not lease[\u0027start_date\u0027] \u003c date \u003c lease[\u0027end_date\u0027]:"},{"line_number":448,"context_line":"            raise common_ex.NotAuthorized("},{"line_number":449,"context_line":"                \u0027Datetime is out of lease limits\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5l8%3D","line":446,"in_reply_to":"AAAAXX%2F%2F%2FGg%3D","updated":"2014-04-25 13:00:19.000000000","message":"Will do. Thanks","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"90f1a0b2b7f5a9e55d3155b4fc8760285ad40b78","unresolved":false,"context_lines":[{"line_number":469,"context_line":"                before_end_date \u003d new_lease[\u0027end_date\u0027] - prev_before_end_delta"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"                # check that before_end_date is not lower than new start_date"},{"line_number":472,"context_line":"                if before_end_date \u003c new_lease[\u0027start_date\u0027]:"},{"line_number":473,"context_line":"                    LOG.info(\"New start_date greater than before_end_date. \""},{"line_number":474,"context_line":"                             \"Setting before_end_date to: %s\""},{"line_number":475,"context_line":"                             % new_lease[\u0027start_date\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F%2B2Y%3D","line":472,"updated":"2014-04-24 21:20:59.000000000","message":"This validation is done when creating and when updating a lease. \nI think it\u0027s worth it to move this to a method to be called in both cases.","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"6b2f6be6bc9976b5a6b4c019cc11fb5f6f1d4c2d","unresolved":false,"context_lines":[{"line_number":469,"context_line":"                before_end_date \u003d new_lease[\u0027end_date\u0027] - prev_before_end_delta"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"                # check that before_end_date is not lower than new start_date"},{"line_number":472,"context_line":"                if before_end_date \u003c new_lease[\u0027start_date\u0027]:"},{"line_number":473,"context_line":"                    LOG.info(\"New start_date greater than before_end_date. \""},{"line_number":474,"context_line":"                             \"Setting before_end_date to: %s\""},{"line_number":475,"context_line":"                             % new_lease[\u0027start_date\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5lE%3D","line":472,"in_reply_to":"AAAAXX%2F%2F%2B2Y%3D","updated":"2014-04-25 13:00:19.000000000","message":"Sorry. I thought that instead of calling a function to do the check, I just could do the check right there. It\u0027s quicker to do it in this way (sorry, but ASM and C++ habits)","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"90f1a0b2b7f5a9e55d3155b4fc8760285ad40b78","unresolved":false,"context_lines":[{"line_number":472,"context_line":"                if before_end_date \u003c new_lease[\u0027start_date\u0027]:"},{"line_number":473,"context_line":"                    LOG.info(\"New start_date greater than before_end_date. \""},{"line_number":474,"context_line":"                             \"Setting before_end_date to: %s\""},{"line_number":475,"context_line":"                             % new_lease[\u0027start_date\u0027])"},{"line_number":476,"context_line":"                    before_end_date \u003d new_lease[\u0027start_date\u0027]"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"            # update time value with before_end_date"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F%2B20%3D","line":475,"updated":"2014-04-24 21:20:59.000000000","message":"I don\u0027t think logging this is necessary","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"6b2f6be6bc9976b5a6b4c019cc11fb5f6f1d4c2d","unresolved":false,"context_lines":[{"line_number":472,"context_line":"                if before_end_date \u003c new_lease[\u0027start_date\u0027]:"},{"line_number":473,"context_line":"                    LOG.info(\"New start_date greater than before_end_date. \""},{"line_number":474,"context_line":"                             \"Setting before_end_date to: %s\""},{"line_number":475,"context_line":"                             % new_lease[\u0027start_date\u0027])"},{"line_number":476,"context_line":"                    before_end_date \u003d new_lease[\u0027start_date\u0027]"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"            # update time value with before_end_date"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5k4%3D","line":475,"in_reply_to":"AAAAXX%2F%2F%2B20%3D","updated":"2014-04-25 13:00:19.000000000","message":"Same as above","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9225,"name":"Cristian A Sanchez","email":"cabsanchez@gmail.com","username":"casanch1"},"change_message_id":"7e452db1c082f153051ee080bddcc522eb7acfe8","unresolved":false,"context_lines":[{"line_number":472,"context_line":"                if before_end_date \u003c new_lease[\u0027start_date\u0027]:"},{"line_number":473,"context_line":"                    LOG.info(\"New start_date greater than before_end_date. \""},{"line_number":474,"context_line":"                             \"Setting before_end_date to: %s\""},{"line_number":475,"context_line":"                             % new_lease[\u0027start_date\u0027])"},{"line_number":476,"context_line":"                    before_end_date \u003d new_lease[\u0027start_date\u0027]"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"            # update time value with before_end_date"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAXX%2F%2F5fY%3D","line":475,"in_reply_to":"AAAAXX%2F%2F5k4%3D","updated":"2014-04-25 13:10:07.000000000","message":"I\u0027m fine if you want to keep the log line. But I think it\u0027ll be better to log a warning. And the lease name should also be logged, so the admin can match the log line with a particular lease.","commit_id":"c8eb544d1a8d34365910cdac621df6ee3457a1a7"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"1eff918d5d961638592356cc247a13576a617407","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                    before_end_date)"},{"line_number":221,"context_line":"                self._check_date_within_lease_limits(before_end_date,"},{"line_number":222,"context_line":"                                                     lease_values)"},{"line_number":223,"context_line":"            except Exception as e:"},{"line_number":224,"context_line":"                LOG.error(\"Invalid before_end_date param. %s\" % e.message)"},{"line_number":225,"context_line":"                raise e"},{"line_number":226,"context_line":"        elif CONF.manager.notify_hours_before_lease_end \u003e 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXX%2F%2F2D8%3D","line":223,"updated":"2014-04-25 20:17:59.000000000","message":"Please check my reply on patch 4.","commit_id":"2d1cc695cf7508b1a3a3f9ab5a26f10461363fd2"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"231d2502c4bb51a981b0dec22a37609e42a4c619","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                    before_end_date)"},{"line_number":221,"context_line":"                self._check_date_within_lease_limits(before_end_date,"},{"line_number":222,"context_line":"                                                     lease_values)"},{"line_number":223,"context_line":"            except Exception as e:"},{"line_number":224,"context_line":"                LOG.error(\"Invalid before_end_date param. %s\" % e.message)"},{"line_number":225,"context_line":"                raise e"},{"line_number":226,"context_line":"        elif CONF.manager.notify_hours_before_lease_end \u003e 0:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXX%2F%2Fvho%3D","line":223,"in_reply_to":"AAAAXX%2F%2F2D8%3D","updated":"2014-04-28 10:17:31.000000000","message":"+1, all these exceptions should be inherited from the ClimateException","commit_id":"2d1cc695cf7508b1a3a3f9ab5a26f10461363fd2"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"08eb0ad19a1aa6e3a4c173fb322fd1068e1b4b58","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                LOG.error(\"Invalid before_end_date param. %s\" % e.message)"},{"line_number":225,"context_line":"                raise e"},{"line_number":226,"context_line":"        elif CONF.manager.notify_hours_before_lease_end \u003e 0:"},{"line_number":227,"context_line":"            delta \u003d datetime.timedelta("},{"line_number":228,"context_line":"                hours\u003dCONF.manager.notify_hours_before_lease_end)"},{"line_number":229,"context_line":"            before_end_date \u003d lease_values[\u0027end_date\u0027] - delta"},{"line_number":230,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXX%2F%2FtVo%3D","line":227,"updated":"2014-04-28 14:55:46.000000000","message":"Should this configuration option be validated here? Sorry for asking, but I don\u0027t know if that is performed elsewhere.","commit_id":"e91c3d32114e5f5e7b06941fbc3a620adfefda3d"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"3e407be5f40fe4eb352e203f5e07e3f8e6fb795e","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                LOG.error(\"Invalid before_end_date param. %s\" % e.message)"},{"line_number":225,"context_line":"                raise e"},{"line_number":226,"context_line":"        elif CONF.manager.notify_hours_before_lease_end \u003e 0:"},{"line_number":227,"context_line":"            delta \u003d datetime.timedelta("},{"line_number":228,"context_line":"                hours\u003dCONF.manager.notify_hours_before_lease_end)"},{"line_number":229,"context_line":"            before_end_date \u003d lease_values[\u0027end_date\u0027] - delta"},{"line_number":230,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXX%2F%2FtN0%3D","line":227,"in_reply_to":"AAAAXX%2F%2FtVo%3D","updated":"2014-04-28 15:03:26.000000000","message":"The only validation made is in the \"elif\" statement (similar to the one made on the previous version).","commit_id":"e91c3d32114e5f5e7b06941fbc3a620adfefda3d"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"08eb0ad19a1aa6e3a4c173fb322fd1068e1b4b58","unresolved":false,"context_lines":[{"line_number":324,"context_line":"            try:"},{"line_number":325,"context_line":"                before_end_date \u003d self._date_from_string(before_end_date)"},{"line_number":326,"context_line":"                self._check_date_within_lease_limits(before_end_date, values)"},{"line_number":327,"context_line":"            except Exception as e:"},{"line_number":328,"context_line":"                LOG.error(\"Invalid before_end_date param. %s\" % e.message)"},{"line_number":329,"context_line":"                raise e"},{"line_number":330,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAXX%2F%2FtW0%3D","line":327,"updated":"2014-04-28 14:55:46.000000000","message":"You forgot to change the Exception thing here.","commit_id":"e91c3d32114e5f5e7b06941fbc3a620adfefda3d"}],"climate/tests/manager/test_service.py":[{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"af0825fddaeec2e3fa179f3c14e3dc834117a2da","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        # end lease event"},{"line_number":384,"context_line":"        event \u003d lease_values[\u0027events\u0027][2]"},{"line_number":385,"context_line":"        self.assertEqual(\u0027before_end_lease\u0027, event[\u0027event_type\u0027])"},{"line_number":386,"context_line":"        expected_before_end_time \u003d datetime.datetime.strptime("},{"line_number":387,"context_line":"            before_end_notification, service.LEASE_DATE_FORMAT)"},{"line_number":388,"context_line":"        self.assertEqual(expected_before_end_time, event[\u0027time\u0027])"},{"line_number":389,"context_line":"        self.assertEqual(\u0027UNDONE\u0027, event[\u0027status\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAXH%2F%2FIT4%3D","line":386,"updated":"2014-04-23 19:58:14.000000000","message":"I think that expected_before_end_time should be the event start_date. If I\u0027m wrong, this test seems to be the same that test_create_lease_with_before_end_notification_param","commit_id":"5b2f417795a19d8bae7e9b0bbd27a31ffcabd5f5"}]}
