From 15f5f267a672197f009608605e64c9fb3a4ae3a4 Mon Sep 17 00:00:00 2001 From: Yumeng Bao Date: Sat, 28 Jul 2018 15:12:01 +0800 Subject: [PATCH] fix audit delete failure Change-Id: Id69ef3a86c5ab234c0e8a4851bc1daadc56935c5 Closes-Bug: #1783969 --- watcher_dashboard/api/watcher.py | 4 ++-- watcher_dashboard/test/api_tests/watcher_tests.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/watcher_dashboard/api/watcher.py b/watcher_dashboard/api/watcher.py index 0a2a456..7ce6423 100644 --- a/watcher_dashboard/api/watcher.py +++ b/watcher_dashboard/api/watcher.py @@ -127,7 +127,7 @@ class Audit(base.APIDictWrapper): the ID :rtype: :py:class:`~.Audit` """ - return watcherclient(request).audit.get(audit_id=audit_id) + return watcherclient(request).audit.get(audit=audit_id) @classmethod def delete(cls, request, audit_id): @@ -139,7 +139,7 @@ class Audit(base.APIDictWrapper): :param audit_id: audit id :type audit_id: int """ - watcherclient(request).audit.delete(audit_id=audit_id) + return watcherclient(request).audit.delete(audit=audit_id) @property def id(self): diff --git a/watcher_dashboard/test/api_tests/watcher_tests.py b/watcher_dashboard/test/api_tests/watcher_tests.py index 3638762..669fdf0 100644 --- a/watcher_dashboard/test/api_tests/watcher_tests.py +++ b/watcher_dashboard/test/api_tests/watcher_tests.py @@ -207,7 +207,7 @@ class WatcherAPITests(test.APITestCase): ret_val = api.watcher.Audit.get(self.request, audit_id) self.assertIsInstance(ret_val, dict) watcherclient.audit.get.assert_called_with( - audit_id=audit_id) + audit=audit_id) def test_audit_create(self): audit = self.api_audits.first() @@ -275,7 +275,7 @@ class WatcherAPITests(test.APITestCase): api.watcher.Audit.delete(self.request, audit_id) watcherclient.audit.delete.assert_called_with( - audit_id=audit_id) + audit=audit_id) def test_action_plan_list(self): action_plans = {'action_plans': self.api_action_plans.list()}