)]}'
{"watcher/decision_engine/audit/base.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"d43ff7da7a13e14feba56926276c4810397b3f6c","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def pre_execute(self, audit, request_context):"},{"line_number":106,"context_line":"        LOG.debug(\"Trigger audit %s\", audit.uuid)"},{"line_number":107,"context_line":"        a_plan_filters \u003d {\u0027state\u0027: objects.action_plan.State.ONGOING}"},{"line_number":108,"context_line":"        ongoing_action_plans \u003d objects.ActionPlan.list("},{"line_number":109,"context_line":"            request_context, filters\u003da_plan_filters)"},{"line_number":110,"context_line":"        if ongoing_action_plans:"},{"line_number":111,"context_line":"            raise exception.ActionPlanIsOngoing("},{"line_number":112,"context_line":"                action_plan\u003dongoing_action_plans[0].uuid)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # change state of the audit to ONGOING"},{"line_number":115,"context_line":"        self.update_audit_state(audit, objects.audit.State.ONGOING)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_e03afb97","line":112,"range":{"start_line":107,"start_character":0,"end_line":112,"end_character":57},"updated":"2017-02-16 13:09:08.000000000","message":"nit: can you extract this into a separate method please?","commit_id":"303cd33f7280cefc2b36b4e66923408853dbb383"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"2a31981b3e63435e85f2a904739f4256d5ef872f","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def pre_execute(self, audit, request_context):"},{"line_number":106,"context_line":"        LOG.debug(\"Trigger audit %s\", audit.uuid)"},{"line_number":107,"context_line":"        a_plan_filters \u003d {\u0027state\u0027: objects.action_plan.State.ONGOING}"},{"line_number":108,"context_line":"        ongoing_action_plans \u003d objects.ActionPlan.list("},{"line_number":109,"context_line":"            request_context, filters\u003da_plan_filters)"},{"line_number":110,"context_line":"        if ongoing_action_plans:"},{"line_number":111,"context_line":"            raise exception.ActionPlanIsOngoing("},{"line_number":112,"context_line":"                action_plan\u003dongoing_action_plans[0].uuid)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # change state of the audit to ONGOING"},{"line_number":115,"context_line":"        self.update_audit_state(audit, objects.audit.State.ONGOING)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_72808147","line":112,"range":{"start_line":107,"start_character":0,"end_line":112,"end_character":57},"in_reply_to":"fa31d9ce_e03afb97","updated":"2017-02-17 06:27:43.000000000","message":"Done","commit_id":"303cd33f7280cefc2b36b4e66923408853dbb383"}],"watcher/tests/decision_engine/audit/test_audit_handlers.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"d43ff7da7a13e14feba56926276c4810397b3f6c","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        mock_list.return_value \u003d [self.ongoing_action_plan]"},{"line_number":199,"context_line":"        audit_handler \u003d oneshot.OneShotAuditHandler(mock.MagicMock())"},{"line_number":200,"context_line":"        self.assertRaises(exception.ActionPlanIsOngoing,"},{"line_number":201,"context_line":"                          audit_handler.pre_execute,"},{"line_number":202,"context_line":"                          self.audit, self.context)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    @mock.patch.object(rpcapi.ApplierAPI, \u0027launch_action_plan\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_e0611baa","line":201,"range":{"start_line":201,"start_character":40,"end_line":201,"end_character":51},"updated":"2017-02-16 13:09:08.000000000","message":"can you instead run handler.execute() with a mock on do_execute() to show it doesn\u0027t get called because of the exception.","commit_id":"303cd33f7280cefc2b36b4e66923408853dbb383"},{"author":{"_account_id":21692,"name":"licanwei","email":"li.canwei2@zte.com.cn","username":"licanwei"},"change_message_id":"2a31981b3e63435e85f2a904739f4256d5ef872f","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        mock_list.return_value \u003d [self.ongoing_action_plan]"},{"line_number":199,"context_line":"        audit_handler \u003d oneshot.OneShotAuditHandler(mock.MagicMock())"},{"line_number":200,"context_line":"        self.assertRaises(exception.ActionPlanIsOngoing,"},{"line_number":201,"context_line":"                          audit_handler.pre_execute,"},{"line_number":202,"context_line":"                          self.audit, self.context)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    @mock.patch.object(rpcapi.ApplierAPI, \u0027launch_action_plan\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_527b7d7b","line":201,"range":{"start_line":201,"start_character":40,"end_line":201,"end_character":51},"in_reply_to":"fa31d9ce_e0611baa","updated":"2017-02-17 06:27:43.000000000","message":"Done","commit_id":"303cd33f7280cefc2b36b4e66923408853dbb383"}]}
