Merge "Add support for cron syntax"
This commit is contained in:
@@ -25,7 +25,8 @@ class AuditTests(base.TestCase):
|
|||||||
list_fields = ['UUID', 'Audit Type', 'State', 'Goal', 'Strategy']
|
list_fields = ['UUID', 'Audit Type', 'State', 'Goal', 'Strategy']
|
||||||
detailed_list_fields = list_fields + ['Created At', 'Updated At',
|
detailed_list_fields = list_fields + ['Created At', 'Updated At',
|
||||||
'Deleted At', 'Parameters',
|
'Deleted At', 'Parameters',
|
||||||
'Interval', 'Audit Scope']
|
'Interval', 'Audit Scope',
|
||||||
|
'Next Run Time']
|
||||||
audit_template_name = 'a' + uuidutils.generate_uuid()
|
audit_template_name = 'a' + uuidutils.generate_uuid()
|
||||||
audit_uuid = None
|
audit_uuid = None
|
||||||
|
|
||||||
|
@@ -68,6 +68,7 @@ AUDIT_1 = {
|
|||||||
'interval': None,
|
'interval': None,
|
||||||
'scope': '',
|
'scope': '',
|
||||||
'auto_trigger': False,
|
'auto_trigger': False,
|
||||||
|
'next_run_time': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
AUDIT_2 = {
|
AUDIT_2 = {
|
||||||
@@ -85,6 +86,7 @@ AUDIT_2 = {
|
|||||||
'interval': None,
|
'interval': None,
|
||||||
'scope': '',
|
'scope': '',
|
||||||
'auto_trigger': False,
|
'auto_trigger': False,
|
||||||
|
'next_run_time': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
AUDIT_3 = {
|
AUDIT_3 = {
|
||||||
@@ -102,6 +104,7 @@ AUDIT_3 = {
|
|||||||
'interval': 3600,
|
'interval': 3600,
|
||||||
'scope': '',
|
'scope': '',
|
||||||
'auto_trigger': True,
|
'auto_trigger': True,
|
||||||
|
'next_run_time': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -150,8 +150,9 @@ class CreateAudit(command.ShowOne):
|
|||||||
'-i', '--interval',
|
'-i', '--interval',
|
||||||
dest='interval',
|
dest='interval',
|
||||||
metavar='<interval>',
|
metavar='<interval>',
|
||||||
help=_('Audit interval (in seconds). '
|
help=_('Audit interval (in seconds or cron format). '
|
||||||
"Only used if the audit is CONTINUOUS."))
|
'Cron inteval can be used like: "*/5 * * * *". '
|
||||||
|
'Only used if the audit is CONTINUOUS.'))
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-g', '--goal',
|
'-g', '--goal',
|
||||||
dest='goal',
|
dest='goal',
|
||||||
|
@@ -32,11 +32,12 @@ AUDIT_TEMPLATE_SHORT_LIST_FIELD_LABELS = ['UUID', 'Name', 'Goal', 'Strategy']
|
|||||||
# Audit
|
# Audit
|
||||||
AUDIT_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at',
|
AUDIT_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at',
|
||||||
'state', 'audit_type', 'parameters', 'interval', 'goal_name',
|
'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',
|
AUDIT_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At',
|
||||||
'State', 'Audit Type', 'Parameters', 'Interval', 'Goal',
|
'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',
|
AUDIT_SHORT_LIST_FIELDS = ['uuid', 'audit_type',
|
||||||
'state', 'goal_name', 'strategy_name',
|
'state', 'goal_name', 'strategy_name',
|
||||||
|
Reference in New Issue
Block a user