mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
Changing import
This commit is contained in:
committed by
beeankha
parent
dd49f747a0
commit
2ed3a39b46
@@ -98,7 +98,7 @@ except ImportError:
|
|||||||
missing_modules.append('pytz')
|
missing_modules.append('pytz')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from dateutil.rrule import rrule, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, MO, TU, WE, TH, FR, SA, SU
|
from dateutil import rrule
|
||||||
except ImportError:
|
except ImportError:
|
||||||
missing_modules.append('python.dateutil')
|
missing_modules.append('python.dateutil')
|
||||||
|
|
||||||
@@ -108,22 +108,22 @@ if len(missing_modules) > 0:
|
|||||||
|
|
||||||
class LookupModule(LookupBase):
|
class LookupModule(LookupBase):
|
||||||
frequencies = {
|
frequencies = {
|
||||||
'none': DAILY,
|
'none': rrule.DAILY,
|
||||||
'minute': MINUTELY,
|
'minute': rrule.MINUTELY,
|
||||||
'hour': HOURLY,
|
'hour': rrule.HOURLY,
|
||||||
'day': DAILY,
|
'day': rrule.DAILY,
|
||||||
'week': WEEKLY,
|
'week': rrule.WEEKLY,
|
||||||
'month': MONTHLY,
|
'month': rrule.MONTHLY,
|
||||||
}
|
}
|
||||||
|
|
||||||
weekdays = {
|
weekdays = {
|
||||||
'monday': MO,
|
'monday': rrule.MO,
|
||||||
'tuesday': TU,
|
'tuesday': rrule.TU,
|
||||||
'wednesday': WE,
|
'wednesday': rrule.WE,
|
||||||
'thursday': TH,
|
'thursday': rrule.TH,
|
||||||
'friday': FR,
|
'friday': rrule.FR,
|
||||||
'saturday': SA,
|
'saturday': rrule.SA,
|
||||||
'sunday': SU,
|
'sunday': rrule.SU,
|
||||||
}
|
}
|
||||||
|
|
||||||
set_positions = {
|
set_positions = {
|
||||||
@@ -216,7 +216,7 @@ class LookupModule(LookupBase):
|
|||||||
rrule_kwargs['byweekday'] = self.weekdays[weekday]
|
rrule_kwargs['byweekday'] = self.weekdays[weekday]
|
||||||
rrule_kwargs['bysetpos'] = self.set_positions[occurance]
|
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.
|
# 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
|
# So we will do a string manip here if we need to
|
||||||
|
|||||||
Reference in New Issue
Block a user