From 6e858233dc4e9ff34bdb83c6caceaa5e45c7aae9 Mon Sep 17 00:00:00 2001 From: "David.T" Date: Fri, 26 Aug 2016 16:02:42 +0200 Subject: [PATCH] Add again parameters as Audit creation attributes 'parameters' option for audit creation was removed due to a bad merge conflict resolution. Change-Id: I37848ca7c1e8d6cd03996a5a81471edd9802b673 Closes-Bug: #1617320 --- watcherclient/tests/v1/test_audit_shell.py | 2 +- watcherclient/v1/audit_shell.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/watcherclient/tests/v1/test_audit_shell.py b/watcherclient/tests/v1/test_audit_shell.py index 83965b4..cc6e1db 100644 --- a/watcherclient/tests/v1/test_audit_shell.py +++ b/watcherclient/tests/v1/test_audit_shell.py @@ -388,7 +388,7 @@ class AuditShellTest(base.CommandTestCase): self.m_audit_mgr.create.assert_called_once_with( goal='fc087747-61be-4aad-8126-b701731ae836', audit_type='ONESHOT', - parameters=['para1=10', 'para2=20']) + parameters={'para1': 10, 'para2': 20}) def test_do_audit_create_with_type_continuous(self): audit = resource.Audit(mock.Mock(), AUDIT_1) diff --git a/watcherclient/v1/audit_shell.py b/watcherclient/v1/audit_shell.py index ac3de56..1d37b20 100644 --- a/watcherclient/v1/audit_shell.py +++ b/watcherclient/v1/audit_shell.py @@ -184,6 +184,7 @@ class CreateAudit(command.ShowOne): fields = dict((k, v) for (k, v) in vars(parsed_args).items() if k in field_list and v is not None) + fields = common_utils.args_array_to_dict(fields, 'parameters') if fields.get('goal'): if not uuidutils.is_uuid_like(fields['goal']):