Skip to content

Commit

Permalink
Schedule rruleset fix related #13446 (#13611)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Pavon <[email protected]>
Co-authored-by: Jessica Steurer <[email protected]>
  • Loading branch information
KaraokeKev and jay-steurer authored Aug 16, 2023
1 parent bb1c155 commit b8ec7c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion awx_collection/plugins/lookup/schedule_rruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def process_list(self, field_name, rule, valid_list, rule_number):
if not isinstance(rule[field_name], list):
rule[field_name] = rule[field_name].split(',')
for value in rule[field_name]:
value = value.strip()
value = value.strip().lower()
if value not in valid_list:
raise AnsibleError('In rule {0} {1} must only contain values in {2}'.format(rule_number, field_name, ', '.join(valid_list.keys())))
return_values.append(valid_list[value])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,19 @@
that:
- results is success
- "'DTSTART;TZID=UTC:20220430T103045 RRULE:FREQ=MONTHLY;BYMONTHDAY=12,13,14,15,16,17,18;BYDAY=SA;INTERVAL=1' == complex_rule"

- name: mondays, Tuesdays, and WEDNESDAY with case-insensitivity
set_fact:
complex_rule: "{{ query(ruleset_plugin_name, '2022-04-30 10:30:45', rules=rrules, timezone='UTC' ) }}"
ignore_errors: True
register: results
vars:
rrules:
- frequency: 'day'
interval: 1
byweekday: monday, Tuesday, WEDNESDAY

- assert:
that:
- results is success
- "'DTSTART;TZID=UTC:20220430T103045 RRULE:FREQ=DAILY;BYDAY=MO,TU,WE;INTERVAL=1' == complex_rule"

0 comments on commit b8ec7c4

Please sign in to comment.