Skip to content

Commit d9b11f3

Browse files
committed
More Py2/3 adaptations fetched from production.
- Legacy-Id: 17333
1 parent ab40807 commit d9b11f3

3 files changed

Lines changed: 14 additions & 18 deletions

File tree

bin/daily

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ $DTDIR/ietf/manage.py fetch_meeting_attendance --latest 2
5959

6060
# Send reminders originating from the review app
6161
$DTDIR/ietf/bin/send-review-reminders
62+

bin/mm_hourly

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@
66
# $DTDIR/etc/cron.d/datatracker which should be symlinked from
77
# /etc/cron.d/
88

9+
export LANG=en_US.UTF-8
10+
export PYTHONIOENCODING=utf-8
11+
12+
# Make sure we stop if something goes wrong:
13+
program=${0##*/}
14+
trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)"; exit 1' ERR
15+
916
DTDIR=/a/www/ietf-datatracker/web
1017
cd $DTDIR/
1118

1219
# Set up the virtual environment
1320
source $DTDIR/env/bin/activate
1421

15-
$DTDIR/ietf/manage.py import_mailman_listinfo
22+
logger -p user.info -t cron "Running $DTDIR/bin/mm_hourly"
23+
24+
## XXX commented out pending rewrite -- mailman 2 python interface is not available under Python 3
25+
# $DTDIR/ietf/manage.py import_mailman_listinfo

ietf/virtualenv-manage.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
1-
#!/usr/bin/env python
2-
# Copyright The IETF Trust 2016-2019, All Rights Reserved
1+
#!/a/www/ietf-datatracker/web/env/bin/python
2+
# Copyright The IETF Trust 2016-2020, All Rights Reserved
33
# -*- coding: utf-8 -*-
44

5-
6-
from __future__ import absolute_import, print_function, unicode_literals
7-
8-
import io
95
import os
106
import sys
117

128
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
13-
14-
# change directory so patches etc. will be picked up as expected
15-
os.chdir(path)
16-
17-
# Virtualenv support
18-
virtualenv_activation = os.path.join(path, "env", "bin", "activate_this.py")
19-
if os.path.exists(virtualenv_activation):
20-
exec(compile(io.open(virtualenv_activation, "rb").read(), virtualenv_activation, 'exec'), dict(__file__=virtualenv_activation))
21-
else:
22-
raise RuntimeError("Could not find the expected virtual python environment.")
23-
249
if not path in sys.path:
2510
sys.path.insert(0, path)
2611

0 commit comments

Comments
 (0)