mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 20:05:03 -02:30
Validating the version of python-dateutil
This commit is contained in:
@@ -10,7 +10,7 @@ DOCUMENTATION = """
|
|||||||
short_description: Generate an rrule string which can be used for Tower Schedules
|
short_description: Generate an rrule string which can be used for Tower Schedules
|
||||||
requirements:
|
requirements:
|
||||||
- pytz
|
- pytz
|
||||||
- python.dateutil
|
- python.dateutil >= 2.8.1
|
||||||
description:
|
description:
|
||||||
- Returns a string based on criteria which represent an rule
|
- Returns a string based on criteria which represent an rule
|
||||||
options:
|
options:
|
||||||
@@ -101,6 +101,13 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
missing_modules.append('python.dateutil')
|
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:
|
if len(missing_modules) > 0:
|
||||||
raise AnsibleError('You are missing the modules {0}'.format(', '.join(missing_modules)))
|
raise AnsibleError('You are missing the modules {0}'.format(', '.join(missing_modules)))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user