diff --git a/watcherclient/tests/v1/test_audit_shell.py b/watcherclient/tests/v1/test_audit_shell.py index 1bc377f..d4dbcb5 100644 --- a/watcherclient/tests/v1/test_audit_shell.py +++ b/watcherclient/tests/v1/test_audit_shell.py @@ -48,7 +48,6 @@ AUDIT_1 = { 'created_at': datetime.datetime.now().isoformat(), 'updated_at': None, 'deleted_at': None, - 'period': 3600, } AUDIT_2 = { @@ -61,7 +60,6 @@ AUDIT_2 = { 'created_at': datetime.datetime.now().isoformat(), 'updated_at': None, 'deleted_at': None, - 'period': 3600, } @@ -227,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', period=3600) + type='ONESHOT') def test_do_audit_create_with_audit_template_name(self): audit = resource.Audit(mock.Mock(), AUDIT_1) @@ -243,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', period=3600) + type='ONESHOT') def test_do_audit_create_with_deadline(self): audit = resource.Audit(mock.Mock(), AUDIT_1) @@ -261,8 +259,7 @@ class AuditShellTest(base.CommandTestCase): self.m_audit_mgr.create.assert_called_once_with( audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2', type='ONESHOT', - deadline='2016-04-28T10:48:32.064802', - period=3600) + deadline='2016-04-28T10:48:32.064802') def test_do_audit_create_with_type(self): audit = resource.Audit(mock.Mock(), AUDIT_1) @@ -279,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', period=3600) + type='ONESHOT') diff --git a/watcherclient/v1/audit.py b/watcherclient/v1/audit.py index 2b2d434..830e67c 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', 'period'] +CREATION_ATTRIBUTES = ['audit_template_uuid', 'deadline', 'type'] class Audit(base.Resource): diff --git a/watcherclient/v1/audit_shell.py b/watcherclient/v1/audit_shell.py index a38a05b..c3da48d 100644 --- a/watcherclient/v1/audit_shell.py +++ b/watcherclient/v1/audit_shell.py @@ -132,19 +132,13 @@ class CreateAudit(command.ShowOne): metavar='<type>', default='ONESHOT', help=_("Audit type.")) - parser.add_argument( - '-p', '--period', - dest='period', - metavar='<period>', - default=3600, - help=_("Audit period.")) return parser def take_action(self, parsed_args): client = getattr(self.app.client_manager, "infra-optim") - field_list = ['audit_template_uuid', 'type', 'deadline', 'period'] + field_list = ['audit_template_uuid', '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 72c6578..f88641c 100644 --- a/watcherclient/v1/resource_fields.py +++ b/watcherclient/v1/resource_fields.py @@ -35,11 +35,11 @@ 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', - 'audit_template_name', 'period'] + 'audit_template_name'] AUDIT_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At', 'Deadline', 'State', 'Type', 'Audit Template uuid', - 'Audit Template Name', 'Period'] + 'Audit Template Name'] AUDIT_SHORT_LIST_FIELDS = ['uuid', 'type', 'audit_template_name', 'state']