# Path: watcher_dashboard/utils/errors.py
# def handle_errors(error_message, error_default=None, request_arg=None):
#     def decorator(func):
#         def wrapper(*args, **kwargs):


import logging
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard.api import base
from watcherclient import client as wc
from watcher_dashboard.utils import errors as errors_utils

        :return: the created Audit object
        :rtype:  :py:class:`~.Audit`
        """

        if interval:
            return watcherclient(request).audit.create(
                audit_template_uuid=audit_template_uuid, audit_type=audit_type,
                auto_trigger=auto_trigger, interval=interval, name=name)
        else:
            return watcherclient(request).audit.create(
                audit_template_uuid=audit_template_uuid, audit_type=audit_type,
                auto_trigger=auto_trigger, name=name)

    @classmethod
    def list(cls, request, **filters):
        """Return a list of audits in Watcher

        :param request: request object
        :type  request: django.http.HttpRequest

        :param filters: key/value kwargs used as filters
        :type  filters: dict

        :return: list of audits, or an empty list if there are none
        :rtype:  list of :py:class:`~.Audit`
        """
        return watcherclient(request).audit.list(detail=True, **filters)

    @classmethod

# Path: watcher_dashboard/utils/errors.py
# def handle_errors(error_message, error_default=None, request_arg=None):
#     def decorator(func):
#         def wrapper(*args, **kwargs):


# Path: watcher_dashboard/api/watcher.py
import logging
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard.api import base
from watcherclient import client as wc
from watcher_dashboard.utils import errors as errors_utils


        :return: the created Audit object
        :rtype:  :py:class:`~.Audit`
        """

        if interval:
            return watcherclient(request).audit.create(
                audit_template_uuid=audit_template_uuid, audit_type=audit_type,
                auto_trigger=auto_trigger, interval=interval, name=name)
        else:
            return watcherclient(request).audit.create(
                audit_template_uuid=audit_template_uuid, audit_type=audit_type,
                auto_trigger=auto_trigger, name=name)

    @classmethod
    def list(cls, request, **filters):
        """Return a list of audits in Watcher

        :param request: request object
        :type  request: django.http.HttpRequest

        :param filters: key/value kwargs used as filters
        :type  filters: dict

        :return: list of audits, or an empty list if there are none
        :rtype:  list of :py:class:`~.Audit`
        """
        return watcherclient(request).audit.list(detail=True, **filters)

    @classmethod

    @errors_utils.handle_errors(_("Unable to retrieve audit"))