Fix create audit fail from audit_template
The name is a positional parameter in create() of audit,
but this parameter is not defined when calling from the
audit template. This patch fix it.
Related Bug: #1930565
Change-Id: Id18945b881d150f972dbbd5522010be0157fba17
(cherry picked from commit 2ee3c6015c
)
This commit is contained in:
parent
fe483b97c3
commit
6bd5236dfe
@ -62,8 +62,8 @@ class Audit(base.APIDictWrapper):
|
|||||||
self._request = request
|
self._request = request
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, request, name, audit_template_uuid,
|
def create(cls, request, audit_template_uuid, audit_type, name=None,
|
||||||
audit_type, auto_trigger=False, interval=None):
|
auto_trigger=False, interval=None):
|
||||||
|
|
||||||
"""Create an audit in Watcher
|
"""Create an audit in Watcher
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ class WatcherAPITests(test.APITestCase):
|
|||||||
return_value=audit)
|
return_value=audit)
|
||||||
|
|
||||||
ret_val = api.watcher.Audit.create(
|
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)
|
self.assertIsInstance(ret_val, dict)
|
||||||
watcherclient.audit.create.assert_called_with(
|
watcherclient.audit.create.assert_called_with(
|
||||||
audit_template_uuid=audit_template_uuid,
|
audit_template_uuid=audit_template_uuid,
|
||||||
@ -242,7 +242,7 @@ class WatcherAPITests(test.APITestCase):
|
|||||||
return_value=audit)
|
return_value=audit)
|
||||||
|
|
||||||
ret_val = api.watcher.Audit.create(
|
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)
|
False, interval)
|
||||||
self.assertIsInstance(ret_val, dict)
|
self.assertIsInstance(ret_val, dict)
|
||||||
watcherclient.audit.create.assert_called_with(
|
watcherclient.audit.create.assert_called_with(
|
||||||
@ -265,7 +265,7 @@ class WatcherAPITests(test.APITestCase):
|
|||||||
return_value=audit)
|
return_value=audit)
|
||||||
|
|
||||||
ret_val = api.watcher.Audit.create(
|
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)
|
self.assertIsInstance(ret_val, dict)
|
||||||
watcherclient.audit.create.assert_called_with(
|
watcherclient.audit.create.assert_called_with(
|
||||||
audit_template_uuid=audit_template_uuid,
|
audit_template_uuid=audit_template_uuid,
|
||||||
|
Loading…
Reference in New Issue
Block a user