diff --git a/awx_collection/plugins/lookup/tower_schedule_rrule.py b/awx_collection/plugins/lookup/tower_schedule_rrule.py index 96bd1735e8..f9fecf0289 100644 --- a/awx_collection/plugins/lookup/tower_schedule_rrule.py +++ b/awx_collection/plugins/lookup/tower_schedule_rrule.py @@ -10,7 +10,7 @@ DOCUMENTATION = """ short_description: Generate an rrule string which can be used for Tower Schedules requirements: - pytz - - python.dateutil + - python.dateutil >= 2.8.1 description: - Returns a string based on criteria which represent an rule options: @@ -101,6 +101,13 @@ try: except ImportError: missing_modules.append('python.dateutil') +# Validate the version of python.dateutil +try: + import dateutil + dateutil.__version__ +except Exception: + missing_modules.append('python.dateutil>=2.8.1') + if len(missing_modules) > 0: raise AnsibleError('You are missing the modules {0}'.format(', '.join(missing_modules)))