)]}'
{"vitrage/entity_graph/transformer/plugins/nagios.py":[{"author":{"_account_id":19209,"name":"Liat","email":"liat.har-tal@nokia.com","username":"liat"},"change_message_id":"0685120fc8613ea86862bfaaf986392436b0cf66","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        LOG.warning(\u0027Cannot transform host, host transformer does not exist\u0027)"},{"line_number":110,"context_line":"        return None"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def _extract_action_type(self, entity_event):"},{"line_number":113,"context_line":"        if (entity_event[self.STATUS] \u003d\u003d self.STATUS_OK):"},{"line_number":114,"context_line":"            return EventAction.DELETE"},{"line_number":115,"context_line":"        elif (entity_event[SyncProps.SYNC_MODE] \u003d\u003d SyncMode.INIT_SNAPSHOT):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_edb787f3","line":112,"range":{"start_line":112,"start_character":8,"end_line":112,"end_character":28},"updated":"2016-02-09 07:37:17.000000000","message":"def _extract_action_type(self, entity_event):\n\n        sync_mode \u003d entity_event[SyncProps.SYNC_MODE]\n\n        if sync_mode in (SyncMode.UPDATE, SyncMode.SNAPSHOT):\n\n            if entity_event[self.STATUS] \u003d\u003d \u0027OK\u0027:\n                return EventAction.CREATE\n            else:\n                return EventAction.UPDATE\n\n        if SyncMode.INIT_SNAPSHOT \u003d\u003d sync_mode:\n            return EventAction.CREATE\n\n        raise VitrageTransformerError(\u0027Invalid sync mode: (%s)\u0027 % sync_mode)","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"}],"vitrage/synchronizer/plugins/nagios/parser.py":[{"author":{"_account_id":19209,"name":"Liat","email":"liat.har-tal@nokia.com","username":"liat"},"change_message_id":"0685120fc8613ea86862bfaaf986392436b0cf66","unresolved":false,"context_lines":[{"line_number":96,"context_line":"    def _parse_cell(self, column, xpath):"},{"line_number":97,"context_line":"        contents \u003d column.xpath(xpath)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if len(contents) \u003d\u003d 1:"},{"line_number":100,"context_line":"            return contents[0].text"},{"line_number":101,"context_line":"        elif len(contents) \u003e 1:"},{"line_number":102,"context_line":"            LOG.warn(\u0027Multiple entries for nagios test: %s\u0027, contents.toString)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_cdfc0b75","line":99,"range":{"start_line":99,"start_character":28,"end_line":99,"end_character":29},"updated":"2016-02-09 07:37:17.000000000","message":"should be a constant","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"fc1f3d7a76e2ef75216e5fbebe2a619224dbccbf","unresolved":false,"context_lines":[{"line_number":96,"context_line":"    def _parse_cell(self, column, xpath):"},{"line_number":97,"context_line":"        contents \u003d column.xpath(xpath)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if len(contents) \u003d\u003d 1:"},{"line_number":100,"context_line":"            return contents[0].text"},{"line_number":101,"context_line":"        elif len(contents) \u003e 1:"},{"line_number":102,"context_line":"            LOG.warn(\u0027Multiple entries for nagios test: %s\u0027, contents.toString)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_fc42da67","line":99,"range":{"start_line":99,"start_character":28,"end_line":99,"end_character":29},"in_reply_to":"5a5ae5dd_cdfc0b75","updated":"2016-02-09 08:48:15.000000000","message":"I don\u0027t agree, I think that adding ONE \u003d 1 constant is redundant. all it says is that I expect a single result for the xpath call","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"},{"author":{"_account_id":19134,"name":"Eyal","email":"eyalb1@gmail.com","username":"eyalb"},"change_message_id":"fc9248706b9c539044f1829e961da992836106ef","unresolved":false,"context_lines":[{"line_number":96,"context_line":"    def _parse_cell(self, column, xpath):"},{"line_number":97,"context_line":"        contents \u003d column.xpath(xpath)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        if len(contents) \u003d\u003d 1:"},{"line_number":100,"context_line":"            return contents[0].text"},{"line_number":101,"context_line":"        elif len(contents) \u003e 1:"},{"line_number":102,"context_line":"            LOG.warn(\u0027Multiple entries for nagios test: %s\u0027, contents.toString)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_1fb488cf","line":99,"range":{"start_line":99,"start_character":28,"end_line":99,"end_character":29},"in_reply_to":"5a5ae5dd_fc42da67","updated":"2016-02-09 09:02:26.000000000","message":"I would change to\nif is_empty()\nelif is_single() ..\nelse ..","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"},{"author":{"_account_id":19209,"name":"Liat","email":"liat.har-tal@nokia.com","username":"liat"},"change_message_id":"0685120fc8613ea86862bfaaf986392436b0cf66","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            LOG.warn(\u0027Multiple entries for nagios test: %s\u0027, contents.toString)"},{"line_number":103,"context_line":"            return contents[0].text"},{"line_number":104,"context_line":"        else:"},{"line_number":105,"context_line":"            # len(contents) might be 0 for a host, since each host name appears"},{"line_number":106,"context_line":"            # only once in the table"},{"line_number":107,"context_line":"            return \u0027\u0027"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _parse_host_name(self, column, xpath):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_4dda5b19","line":106,"range":{"start_line":105,"start_character":11,"end_line":106,"end_character":36},"updated":"2016-02-09 07:37:17.000000000","message":"No need for this comment","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"fc1f3d7a76e2ef75216e5fbebe2a619224dbccbf","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            LOG.warn(\u0027Multiple entries for nagios test: %s\u0027, contents.toString)"},{"line_number":103,"context_line":"            return contents[0].text"},{"line_number":104,"context_line":"        else:"},{"line_number":105,"context_line":"            # len(contents) might be 0 for a host, since each host name appears"},{"line_number":106,"context_line":"            # only once in the table"},{"line_number":107,"context_line":"            return \u0027\u0027"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _parse_host_name(self, column, xpath):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_5c676e25","line":106,"range":{"start_line":105,"start_character":11,"end_line":106,"end_character":36},"in_reply_to":"5a5ae5dd_4dda5b19","updated":"2016-02-09 08:48:15.000000000","message":"I think it is needed, since this behavior is not trivial. someone might easily think it\u0027s a mistake and change the code if there is no explanation","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"},{"author":{"_account_id":19209,"name":"Liat","email":"liat.har-tal@nokia.com","username":"liat"},"change_message_id":"0685120fc8613ea86862bfaaf986392436b0cf66","unresolved":false,"context_lines":[{"line_number":109,"context_line":"    def _parse_host_name(self, column, xpath):"},{"line_number":110,"context_line":"        host_name \u003d self._parse_cell(column, xpath)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        # host name appears only once in the table, so keep"},{"line_number":113,"context_line":"        # using the same host name until found a new one"},{"line_number":114,"context_line":"        if host_name:"},{"line_number":115,"context_line":"            self.last_host_name \u003d host_name"},{"line_number":116,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_2de11fd1","line":113,"range":{"start_line":112,"start_character":8,"end_line":113,"end_character":56},"updated":"2016-02-09 07:37:17.000000000","message":"No need for this comment.\n\nIf you think this is mandatory, it is better to explain in the method header","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"}],"vitrage/synchronizer/plugins/nagios/plugin.py":[{"author":{"_account_id":19209,"name":"Liat","email":"liat.har-tal@nokia.com","username":"liat"},"change_message_id":"0685120fc8613ea86862bfaaf986392436b0cf66","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        services_to_update \u003d []"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        for service in nagios_services:"},{"line_number":84,"context_line":"            # return all erroneous services, plus services that their status"},{"line_number":85,"context_line":"            # has changed from erroneous to OK"},{"line_number":86,"context_line":"            service_key \u003d self.ServiceKey("},{"line_number":87,"context_line":"                host_name\u003dservice[NagiosProps.RESOURCE_NAME],"},{"line_number":88,"context_line":"                service\u003dservice[NagiosProps.SERVICE])"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_ed0f8786","line":85,"range":{"start_line":84,"start_character":12,"end_line":85,"end_character":46},"updated":"2016-02-09 07:37:17.000000000","message":"no need for this comment","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"},{"author":{"_account_id":19159,"name":"Ifat Afek","email":"ifat.afek@nokia.com","username":"ifat_afek"},"change_message_id":"fc1f3d7a76e2ef75216e5fbebe2a619224dbccbf","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        services_to_update \u003d []"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        for service in nagios_services:"},{"line_number":84,"context_line":"            # return all erroneous services, plus services that their status"},{"line_number":85,"context_line":"            # has changed from erroneous to OK"},{"line_number":86,"context_line":"            service_key \u003d self.ServiceKey("},{"line_number":87,"context_line":"                host_name\u003dservice[NagiosProps.RESOURCE_NAME],"},{"line_number":88,"context_line":"                service\u003dservice[NagiosProps.SERVICE])"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_3cbb9277","line":85,"range":{"start_line":84,"start_character":12,"end_line":85,"end_character":46},"in_reply_to":"5a5ae5dd_ed0f8786","updated":"2016-02-09 08:48:15.000000000","message":"I think it is needed, since this behavior is not trivial","commit_id":"d6df24a2ec19a2e1a6e57106a9d37e26d5452532"}]}
