Merge "Fix create audit fail from audit_template"

This commit is contained in:
Zuul 2021-07-05 13:46:10 +00:00 committed by Gerrit Code Review
commit 4daaec6665
2 changed files with 5 additions and 5 deletions

View File

@ -62,8 +62,8 @@ class Audit(base.APIDictWrapper):
self._request = request
@classmethod
def create(cls, request, name, audit_template_uuid,
audit_type, auto_trigger=False, interval=None):
def create(cls, request, audit_template_uuid, audit_type, name=None,
auto_trigger=False, interval=None):
"""Create an audit in Watcher

View File

@ -222,7 +222,7 @@ class WatcherAPITests(test.APITestCase):
return_value=audit)
ret_val = api.watcher.Audit.create(
self.request, audit_name, audit_template_uuid, audit_type)
self.request, audit_template_uuid, audit_type, audit_name)
self.assertIsInstance(ret_val, dict)
watcherclient.audit.create.assert_called_with(
audit_template_uuid=audit_template_uuid,
@ -242,7 +242,7 @@ class WatcherAPITests(test.APITestCase):
return_value=audit)
ret_val = api.watcher.Audit.create(
self.request, audit_name, audit_template_uuid, audit_type,
self.request, audit_template_uuid, audit_type, audit_name,
False, interval)
self.assertIsInstance(ret_val, dict)
watcherclient.audit.create.assert_called_with(
@ -265,7 +265,7 @@ class WatcherAPITests(test.APITestCase):
return_value=audit)
ret_val = api.watcher.Audit.create(
self.request, audit_name, audit_template_uuid, audit_type, True)
self.request, audit_template_uuid, audit_type, audit_name, True)
self.assertIsInstance(ret_val, dict)
watcherclient.audit.create.assert_called_with(
audit_template_uuid=audit_template_uuid,