Merge "Add support for cron syntax"

This commit is contained in:
Jenkins 2017-07-21 09:10:07 +00:00 committed by Gerrit Code Review
commit 4bb678f7a5
4 changed files with 11 additions and 5 deletions

View File

@ -25,7 +25,8 @@ class AuditTests(base.TestCase):
list_fields = ['UUID', 'Audit Type', 'State', 'Goal', 'Strategy']
detailed_list_fields = list_fields + ['Created At', 'Updated At',
'Deleted At', 'Parameters',
'Interval', 'Audit Scope']
'Interval', 'Audit Scope',
'Next Run Time']
audit_template_name = 'a' + uuidutils.generate_uuid()
audit_uuid = None

View File

@ -68,6 +68,7 @@ AUDIT_1 = {
'interval': None,
'scope': '',
'auto_trigger': False,
'next_run_time': None,
}
AUDIT_2 = {
@ -85,6 +86,7 @@ AUDIT_2 = {
'interval': None,
'scope': '',
'auto_trigger': False,
'next_run_time': None,
}
AUDIT_3 = {
@ -102,6 +104,7 @@ AUDIT_3 = {
'interval': 3600,
'scope': '',
'auto_trigger': True,
'next_run_time': None,
}

View File

@ -150,8 +150,9 @@ class CreateAudit(command.ShowOne):
'-i', '--interval',
dest='interval',
metavar='<interval>',
help=_('Audit interval (in seconds). '
"Only used if the audit is CONTINUOUS."))
help=_('Audit interval (in seconds or cron format). '
'Cron inteval can be used like: "*/5 * * * *". '
'Only used if the audit is CONTINUOUS.'))
parser.add_argument(
'-g', '--goal',
dest='goal',

View File

@ -32,11 +32,12 @@ AUDIT_TEMPLATE_SHORT_LIST_FIELD_LABELS = ['UUID', 'Name', 'Goal', 'Strategy']
# Audit
AUDIT_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at',
'state', 'audit_type', 'parameters', 'interval', 'goal_name',
'strategy_name', 'scope', 'auto_trigger']
'strategy_name', 'scope', 'auto_trigger', 'next_run_time']
AUDIT_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At',
'State', 'Audit Type', 'Parameters', 'Interval', 'Goal',
'Strategy', 'Audit Scope', 'Auto Trigger']
'Strategy', 'Audit Scope', 'Auto Trigger',
'Next Run Time']
AUDIT_SHORT_LIST_FIELDS = ['uuid', 'audit_type',
'state', 'goal_name', 'strategy_name',