)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"f5835778c4bc929a677b7f09b886503557acd4bb","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Abhinav \u003cguptaabhinav206@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-02-09 05:02:34 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Closes-Bug: #1594979 Subtracted utc offset from update_timestamp in nagios"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Ifcb8d738a3093064677660d0eef645d26b2a078c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa31d9ce_4daca2a0","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":74},"updated":"2017-02-12 10:32:30.000000000","message":"Please split to two separate lines:\nSubstracted... \nCloses-Bug:...\n\nThen you\u0027ll see the bug in launchpad updated with a link to your change","commit_id":"097536b5e5dd79c85068cb4134f896586c0cad2d"}],"vitrage/datasources/nagios/transformer.py":[{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"5a7d418778d323ac46ba63abcc3c8917dbbd5cb7","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def _create_vertex(self, entity_event):"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        ts \u003d time.time()"},{"line_number":47,"context_line":"        utc_offset \u003d (datetime_utils.datetime.fromtimestamp(ts) -"},{"line_number":48,"context_line":"                      datetime_utils.datetime.utcfromtimestamp(ts)).total_seconds()"},{"line_number":49,"context_line":"        update_timestamp \u003d datetime_utils.datetime.strptime(entity_event[NagiosProperties.LAST_CHECK],"},{"line_number":50,"context_line":"                                                            \u0027%Y-%m-%d %H:%M:%S\u0027) - \\"},{"line_number":51,"context_line":"                           datetime_utils.timedelta(seconds\u003dutc_offset)"},{"line_number":52,"context_line":"        update_timestamp \u003d datetime_utils.change_time_str_format("},{"line_number":53,"context_line":"            str(update_timestamp),"},{"line_number":54,"context_line":"            \u0027%Y-%m-%d %H:%M:%S\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a430d35_57105659","line":51,"range":{"start_line":46,"start_character":0,"end_line":51,"end_character":71},"updated":"2017-02-08 06:09:15.000000000","message":"This seems like a long calculation. Can you please check in google if there is an easier way to subtract the utc? I would expect a datetime method to do that","commit_id":"dde6a03889f1ce0274f70abfaaaafa15ad4514be"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"5a7d418778d323ac46ba63abcc3c8917dbbd5cb7","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        update_timestamp \u003d datetime_utils.change_time_str_format("},{"line_number":53,"context_line":"            str(update_timestamp),"},{"line_number":54,"context_line":"            \u0027%Y-%m-%d %H:%M:%S\u0027,"},{"line_number":55,"context_line":"            tbase.TIMESTAMP_FORMAT)"},{"line_number":56,"context_line":"        sample_timestamp \u003d entity_event[DSProps.SAMPLE_DATE]"},{"line_number":57,"context_line":"        update_timestamp \u003d self._format_update_timestamp(update_timestamp,"},{"line_number":58,"context_line":"                                                         sample_timestamp)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a430d35_f7530237","line":55,"range":{"start_line":55,"start_character":12,"end_line":55,"end_character":34},"updated":"2017-02-08 06:09:15.000000000","message":"I\u0027m surprised to see this change here...\ntbase.TIMESTAMP_FORMAT was the original code, so why does it look like you modified it?","commit_id":"dde6a03889f1ce0274f70abfaaaafa15ad4514be"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"f5835778c4bc929a677b7f09b886503557acd4bb","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _create_vertex(self, entity_event):"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        update_timestamp \u003d datetime_utils.change_time_str_format("},{"line_number":48,"context_line":"            entity_event[NagiosProperties.LAST_CHECK],"},{"line_number":49,"context_line":"            \u0027%Y-%m-%d %H:%M:%S\u0027,"},{"line_number":50,"context_line":"            tbase.TIMESTAMP_FORMAT)"},{"line_number":51,"context_line":"        update_timestamp \u003d datetime_utils.datetime.strptime("},{"line_number":52,"context_line":"            update_timestamp, tbase.TIMESTAMP_FORMAT)"},{"line_number":53,"context_line":"        update_timestamp \u003d update_timestamp - timedelta("},{"line_number":54,"context_line":"            seconds\u003d(datetime_utils.datetime.now() - datetime_utils."},{"line_number":55,"context_line":"                     datetime.utcnow()).total_seconds())"},{"line_number":56,"context_line":"        update_timestamp \u003d update_timestamp.strftime(tbase.TIMESTAMP_FORMAT)"},{"line_number":57,"context_line":"        sample_timestamp \u003d entity_event[DSProps.SAMPLE_DATE]"},{"line_number":58,"context_line":"        update_timestamp \u003d self._format_update_timestamp(update_timestamp,"},{"line_number":59,"context_line":"                                                         sample_timestamp)"},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_edc47660","line":57,"range":{"start_line":47,"start_character":0,"end_line":57,"end_character":60},"updated":"2017-02-12 10:32:30.000000000","message":"The function datetime_utils.change_time_str_format already calls strptime and strftime. It\u0027s a waste to call it again. Please move the entire code block to a function in datetime_utils (name it change_time_zone_and_format or something similar), and call it instead of change_time_str_format.\n\nAlso, please write a unit test for your change in test_nagios_transformer.py","commit_id":"097536b5e5dd79c85068cb4134f896586c0cad2d"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"0a6eb83ad807c0b3a89e503d34e479fb25a02d94","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def _create_vertex(self, entity_event):"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        update_timestamp \u003d datetime_utils.change_to_utc_time_and_format("},{"line_number":42,"context_line":"            entity_event[NagiosProperties.LAST_CHECK], \u0027%Y-%m-%d %H:%M:%S\u0027)"},{"line_number":43,"context_line":"        sample_timestamp \u003d entity_event[DSProps.SAMPLE_DATE]"},{"line_number":44,"context_line":"        update_timestamp \u003d self._format_update_timestamp(update_timestamp,"},{"line_number":45,"context_line":"                                                         sample_timestamp)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_b2b6cbf6","line":42,"range":{"start_line":42,"start_character":74,"end_line":42,"end_character":75},"updated":"2017-03-05 08:28:54.000000000","message":"Please add also a new_format parameter, and pass tbase.TIMESTAMP_FORMAT - like is done in the other datasources. I realize that tbase.TIMESTAMP_FORMAT is the same as the TIMESTAMP_FORMAT that you used inside the function, but I think we should have a unified behavior for all datasources.","commit_id":"452642136304e6a40cb198acc25b6353518ca9e9"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"4f1a5e214631a5b2794368ad066f8874d2f17cb9","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def _create_vertex(self, entity_event):"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        update_timestamp \u003d datetime_utils.change_to_utc_time_and_format("},{"line_number":42,"context_line":"            entity_event[NagiosProperties.LAST_CHECK], \u0027%Y-%m-%d %H:%M:%S\u0027,"},{"line_number":43,"context_line":"            tbase.TIMESTAMP_FORMAT)"},{"line_number":44,"context_line":"        sample_timestamp \u003d entity_event[DSProps.SAMPLE_DATE]"},{"line_number":45,"context_line":"        update_timestamp \u003d self._format_update_timestamp(update_timestamp,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba2be162_2db44033","line":42,"range":{"start_line":42,"start_character":55,"end_line":42,"end_character":74},"updated":"2017-03-05 10:54:03.000000000","message":"Hopefully this would be my last comment :-)\n\nPlease write the \u0027%Y-%m-%d %H:%M:%S\u0027 in a new line, to have each parameter in its own separate line","commit_id":"161137867e7e451dff59a2831fcb1b6f3924e677"}],"vitrage/tests/unit/datasources/nagios/test_nagios_transformer.py":[{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"77b1a911baefbbb84f541919feabbf22a091a1f4","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        self.assertEqual(EntityCategory.ALARM, vertex[VProps.CATEGORY])"},{"line_number":119,"context_line":"        self.assertEqual(event[DSProps.ENTITY_TYPE], vertex[VProps.TYPE])"},{"line_number":120,"context_line":"        self.assertEqual(event[NagiosProperties.SERVICE], vertex[VProps.NAME])"},{"line_number":121,"context_line":"        vertex_transform \u003d NagiosTransformer(self.transformers, self.conf). \\"},{"line_number":122,"context_line":"            _create_vertex(event)"},{"line_number":123,"context_line":"        self.assertEqual(vertex[VProps.UPDATE_TIMESTAMP],"},{"line_number":124,"context_line":"                         vertex_transform.get(\u0027update_timestamp\u0027))"},{"line_number":125,"context_line":"        event_type \u003d event.get(DSProps.EVENT_TYPE, None)"},{"line_number":126,"context_line":"        if event_type is not None:"},{"line_number":127,"context_line":"            self.assertEqual(vertex[VProps.STATE],"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa31d9ce_fb071016","line":124,"range":{"start_line":121,"start_character":0,"end_line":124,"end_character":66},"updated":"2017-02-16 13:24:01.000000000","message":"Why not use the vertex that you already have?\nIf you must call _create_vertex to check the functionality listed in this function, then please put it in a new test.\nAlso, I\u0027m not sure I understand why you are comparing vertex and vertex_transform, instead of comparing vertex to the event (and then calculate +- utc)","commit_id":"dbc83091aa54ea0a5b85fdec8ca2cc2504ae2da8"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"4f1a5e214631a5b2794368ad066f8874d2f17cb9","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.assertEqual(event[DSProps.ENTITY_TYPE], vertex[VProps.TYPE])"},{"line_number":122,"context_line":"        self.assertEqual(event[NagiosProperties.SERVICE], vertex[VProps.NAME])"},{"line_number":123,"context_line":"        self.assertEqual(datetime_utils.change_to_utc_time_and_format("},{"line_number":124,"context_line":"            event[NagiosProperties.LAST_CHECK], \u0027%Y-%m-%d %H:%M:%S\u0027,"},{"line_number":125,"context_line":"            tbase.TIMESTAMP_FORMAT),"},{"line_number":126,"context_line":"            vertex[VProps.UPDATE_TIMESTAMP])"},{"line_number":127,"context_line":"        event_type \u003d event.get(DSProps.EVENT_TYPE, None)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba2be162_4d85f457","line":124,"range":{"start_line":124,"start_character":48,"end_line":124,"end_character":67},"updated":"2017-03-05 10:54:03.000000000","message":"Please write the \u0027%Y-%m-%d %H:%M:%S\u0027 in a new line, to have each parameter in its own separate line","commit_id":"161137867e7e451dff59a2831fcb1b6f3924e677"}],"vitrage/utils/datetime.py":[{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"5a7d418778d323ac46ba63abcc3c8917dbbd5cb7","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from __future__ import absolute_import"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from datetime import datetime, timedelta"},{"line_number":18,"context_line":"from oslo_utils import timeutils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a430d35_77a2b24c","line":17,"range":{"start_line":17,"start_character":31,"end_line":17,"end_character":40},"updated":"2017-02-08 06:09:15.000000000","message":"Why did you add this?","commit_id":"dde6a03889f1ce0274f70abfaaaafa15ad4514be"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"77b1a911baefbbb84f541919feabbf22a091a1f4","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    return utc.strftime(new_format)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def change_time_zone_and_format(timestamp_str, old_format):"},{"line_number":36,"context_line":"    timestamp \u003d datetime.strptime(timestamp_str, old_format)"},{"line_number":37,"context_line":"    timestamp \u003d timestamp - timedelta(seconds\u003d("},{"line_number":38,"context_line":"        datetime.now() - datetime.utcnow()).total_seconds())"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa31d9ce_5b649ce4","line":35,"range":{"start_line":35,"start_character":4,"end_line":35,"end_character":31},"updated":"2017-02-16 13:24:01.000000000","message":"I would name it change_to_utc_time_and_format, because this is what you do (you don\u0027t pass a timezone parameter, it\u0027s always utc)","commit_id":"dbc83091aa54ea0a5b85fdec8ca2cc2504ae2da8"}]}
