Skip to content

Commit 179741a

Browse files
authored
Merge pull request #88 from sommersoft/cp_org_patch
Update urrlib3; Fix cp.org/libraries Travis "Should Run"
2 parents cb62109 + 0989cd7 commit 179741a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

adabot/update_cp_org_libraries.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,17 @@ def update_json_file(working_directory, cp_org_dir, output_filename, json_string
166166
# check for the day we want this to run.
167167
if "TRAVIS" in os.environ:
168168
should_run = int(os.environ["CP_ORG_UPDATER_RUN_DAY"])
169-
if datetime.datetime.weekday(run_time) != should_run:
170-
should_run_date = datetime.date.today() - datetime.timedelta(days=(6 - should_run))
169+
if run_time.isoweekday() != should_run:
170+
delta_days = should_run - run_time.isoweekday()
171+
run_delta = datetime.timedelta(days=delta_days)
172+
should_run_date = run_time + run_delta
171173
msg = [
172174
"Aborting...",
173175
" - Today is not {}.".format(should_run_date.strftime("%A")),
176+
" - Next scheduled run is: {}".format(should_run_date.strftime("%Y-%m-%d")),
174177
" - To run the updater on a different day, change the",
175178
" 'CP_ORG_UPDATER_RUN_DAY' environment variable in Travis.",
176-
" - Day is a number between 0 & 6, with 0 being Monday."
179+
" - Day is a number between 1 & 7, with 1 being Monday."
177180
]
178181
print("\n".join(msg))
179182
sys.exit()

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ idna==2.6
44
redis==2.10.6
55
requests==2.20.0
66
sh==1.12.14
7-
urllib3==1.24.2
7+
urllib3==1.24.3

0 commit comments

Comments
 (0)