diff --git a/watcherclient/tests/v1/test_audit.py b/watcherclient/tests/v1/test_audit.py index 4875246..2701815 100644 --- a/watcherclient/tests/v1/test_audit.py +++ b/watcherclient/tests/v1/test_audit.py @@ -27,7 +27,7 @@ AUDIT1 = { 'id': 1, 'uuid': 'f8e47706-efcf-49a4-a5c4-af604eb492f2', 'deadline': None, - 'type': 'ONE_SHOT', + 'audit_type': 'ONE_SHOT', 'audit_template_uuid': '770ef053-ecb3-48b0-85b5-d55a2dbc6588' } @@ -35,7 +35,7 @@ AUDIT2 = { 'id': 2, 'uuid': 'a5199d0e-0702-4613-9234-5ae2af8dafea', 'deadline': None, - 'type': 'ONE_SHOT', + 'audit_type': 'ONE_SHOT', 'audit_template_uuid': '770ef053-ecb3-48b0-85b5-d55a2dbc6588' } diff --git a/watcherclient/tests/v1/test_audit_shell.py b/watcherclient/tests/v1/test_audit_shell.py index d4dbcb5..6debdee 100644 --- a/watcherclient/tests/v1/test_audit_shell.py +++ b/watcherclient/tests/v1/test_audit_shell.py @@ -41,7 +41,7 @@ AUDIT_TEMPLATE_1 = { AUDIT_1 = { 'uuid': '5869da81-4876-4687-a1ed-12cd64cf53d9', 'deadline': None, - 'type': 'ONESHOT', + 'audit_type': 'ONESHOT', 'state': 'PENDING', 'audit_template_uuid': 'f8e47706-efcf-49a4-a5c4-af604eb492f2', 'audit_template_name': 'at1', @@ -53,7 +53,7 @@ AUDIT_1 = { AUDIT_2 = { 'uuid': 'a5199d0e-0702-4613-9234-5ae2af8dafea', 'deadline': None, - 'type': 'ONESHOT', + 'audit_type': 'ONESHOT', 'audit_template_uuid': '770ef053-ecb3-48b0-85b5-d55a2dbc6588', 'audit_template_name': 'at2', 'state': 'PENDING', @@ -225,7 +225,7 @@ class AuditShellTest(base.CommandTestCase): result) self.m_audit_mgr.create.assert_called_once_with( audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2', - type='ONESHOT') + audit_type='ONESHOT') def test_do_audit_create_with_audit_template_name(self): audit = resource.Audit(mock.Mock(), AUDIT_1) @@ -241,7 +241,7 @@ class AuditShellTest(base.CommandTestCase): result) self.m_audit_mgr.create.assert_called_once_with( audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2', - type='ONESHOT') + audit_type='ONESHOT') def test_do_audit_create_with_deadline(self): audit = resource.Audit(mock.Mock(), AUDIT_1) @@ -258,7 +258,7 @@ class AuditShellTest(base.CommandTestCase): result) self.m_audit_mgr.create.assert_called_once_with( audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2', - type='ONESHOT', + audit_type='ONESHOT', deadline='2016-04-28T10:48:32.064802') def test_do_audit_create_with_type(self): @@ -276,4 +276,4 @@ class AuditShellTest(base.CommandTestCase): result) self.m_audit_mgr.create.assert_called_once_with( audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2', - type='ONESHOT') + audit_type='ONESHOT') diff --git a/watcherclient/v1/action_plan_shell.py b/watcherclient/v1/action_plan_shell.py index b1b93a3..841d121 100644 --- a/watcherclient/v1/action_plan_shell.py +++ b/watcherclient/v1/action_plan_shell.py @@ -189,9 +189,9 @@ class CreateActionPlan(command.ShowOne): metavar='', help=_('Descrition of the audit.')) parser.add_argument( - '-t', '--type', - dest='type', - metavar='', + '-t', '--audit_type', + dest='audit_type', + metavar='', default='ONESHOT', help=_("ActionPlan type.")) @@ -200,7 +200,7 @@ class CreateActionPlan(command.ShowOne): def take_action(self, parsed_args): client = getattr(self.app.client_manager, "infra-optim") - field_list = ['audit_template_uuid', 'type', 'deadline'] + field_list = ['audit_template_uuid', 'audit_type', 'deadline'] fields = dict((k, v) for (k, v) in vars(parsed_args).items() if k in field_list and v is not None) if fields.get('audit_template_uuid'): diff --git a/watcherclient/v1/audit.py b/watcherclient/v1/audit.py index 830e67c..ab844f6 100644 --- a/watcherclient/v1/audit.py +++ b/watcherclient/v1/audit.py @@ -18,7 +18,7 @@ from watcherclient.common import base from watcherclient.common import utils from watcherclient import exceptions as exc -CREATION_ATTRIBUTES = ['audit_template_uuid', 'deadline', 'type'] +CREATION_ATTRIBUTES = ['audit_template_uuid', 'deadline', 'audit_type'] class Audit(base.Resource): diff --git a/watcherclient/v1/audit_shell.py b/watcherclient/v1/audit_shell.py index c3da48d..cd71be0 100644 --- a/watcherclient/v1/audit_shell.py +++ b/watcherclient/v1/audit_shell.py @@ -127,9 +127,9 @@ class CreateAudit(command.ShowOne): metavar='', help=_('Descrition of the audit.')) parser.add_argument( - '-t', '--type', - dest='type', - metavar='', + '-t', '--audit_type', + dest='audit_type', + metavar='', default='ONESHOT', help=_("Audit type.")) @@ -138,7 +138,7 @@ class CreateAudit(command.ShowOne): def take_action(self, parsed_args): client = getattr(self.app.client_manager, "infra-optim") - field_list = ['audit_template_uuid', 'type', 'deadline'] + field_list = ['audit_template_uuid', 'audit_type', 'deadline'] fields = dict((k, v) for (k, v) in vars(parsed_args).items() if k in field_list and v is not None) if fields.get('audit_template_uuid'): diff --git a/watcherclient/v1/resource_fields.py b/watcherclient/v1/resource_fields.py index f88641c..c031393 100644 --- a/watcherclient/v1/resource_fields.py +++ b/watcherclient/v1/resource_fields.py @@ -34,16 +34,18 @@ AUDIT_TEMPLATE_SHORT_LIST_FIELD_LABELS = ['UUID', 'Name', 'Goal', 'Strategy'] # Audit AUDIT_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at', - 'deadline', 'state', 'type', 'audit_template_uuid', + 'deadline', 'state', 'audit_type', 'audit_template_uuid', 'audit_template_name'] AUDIT_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At', - 'Deadline', 'State', 'Type', 'Audit Template uuid', + 'Deadline', 'State', 'Audit Type', 'Audit Template uuid', 'Audit Template Name'] -AUDIT_SHORT_LIST_FIELDS = ['uuid', 'type', 'audit_template_name', 'state'] +AUDIT_SHORT_LIST_FIELDS = [ + 'uuid', 'audit_type', 'audit_template_name', 'state'] -AUDIT_SHORT_LIST_FIELD_LABELS = ['UUID', 'Type', 'Audit Template', 'State'] +AUDIT_SHORT_LIST_FIELD_LABELS = [ + 'UUID', 'Audit Type', 'Audit Template', 'State'] # Action Plan ACTION_PLAN_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at',