maestro-server/report-app

View on GitHub
app/tasks/audit.py

Summary

Maintainability
A
0 mins
Test Coverage
F
33%

from app import celery
from app.repository.externalMaestroAudit import ExternalMaestroAudit

@celery.task(name="audit.api")
def task_audit(entity_id, tmp):

    path = "audit/reports/%s" % entity_id

    try:
        results = ExternalMaestroAudit()\
                    .put_request(path=path, body=tmp)\
                    .get_results()

        return {'api': results}

    except Exception as error:
        return {'message': str(error)}