From 2ed3a39b46cb77e7e63d9bf29f30555f6e8bec65 Mon Sep 17 00:00:00 2001 From: John Westcott IV Date: Wed, 29 Apr 2020 13:55:23 -0400 Subject: [PATCH] Changing import --- .../plugins/lookup/tower_schedule_rrule.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/awx_collection/plugins/lookup/tower_schedule_rrule.py b/awx_collection/plugins/lookup/tower_schedule_rrule.py index 27b2a589c1..4c43b139be 100644 --- a/awx_collection/plugins/lookup/tower_schedule_rrule.py +++ b/awx_collection/plugins/lookup/tower_schedule_rrule.py @@ -98,7 +98,7 @@ except ImportError: missing_modules.append('pytz') try: - from dateutil.rrule import rrule, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, MO, TU, WE, TH, FR, SA, SU + from dateutil import rrule except ImportError: missing_modules.append('python.dateutil') @@ -108,22 +108,22 @@ if len(missing_modules) > 0: class LookupModule(LookupBase): frequencies = { - 'none': DAILY, - 'minute': MINUTELY, - 'hour': HOURLY, - 'day': DAILY, - 'week': WEEKLY, - 'month': MONTHLY, + 'none': rrule.DAILY, + 'minute': rrule.MINUTELY, + 'hour': rrule.HOURLY, + 'day': rrule.DAILY, + 'week': rrule.WEEKLY, + 'month': rrule.MONTHLY, } weekdays = { - 'monday': MO, - 'tuesday': TU, - 'wednesday': WE, - 'thursday': TH, - 'friday': FR, - 'saturday': SA, - 'sunday': SU, + 'monday': rrule.MO, + 'tuesday': rrule.TU, + 'wednesday': rrule.WE, + 'thursday': rrule.TH, + 'friday': rrule.FR, + 'saturday': rrule.SA, + 'sunday': rrule.SU, } set_positions = { @@ -216,7 +216,7 @@ class LookupModule(LookupBase): rrule_kwargs['byweekday'] = self.weekdays[weekday] rrule_kwargs['bysetpos'] = self.set_positions[occurance] - my_rule = rrule(**rrule_kwargs) + my_rule = rrule.rrule(**rrule_kwargs) # All frequencies can use a timezone but rrule can't support the format that tower uses. # So we will do a string manip here if we need to