The switch to py27 was done a long time ago

This commit is contained in:
Mathieu Agopian 2015-09-29 17:56:57 +02:00
Родитель f10c8dfaff
Коммит bb2cc64318
3 изменённых файлов: 3 добавлений и 47 удалений

Просмотреть файл

@ -143,13 +143,12 @@ To get back into the olympia environment later, type::
workon olympia # requires virtualenvwrapper
.. note:: Olympia requires at least Python 2.6.1, and at most Python 2.7,
production is using Python 2.6.6.
.. note:: Olympia requires Python 2.7.
.. note:: If you want to use a different Python binary, pass the name (if it is
on your path) or the full path to mkvirtualenv with ``--python``::
mkvirtualenv --python=/usr/local/bin/python2.6 olympia
mkvirtualenv --python=/usr/local/bin/python2.7 olympia
Finish the install

Просмотреть файл

@ -13,7 +13,7 @@ def main():
parser.add_option("-u", "--user",
help=("Prefix cron with this user. "
"Only define for cron.d style crontabs"))
parser.add_option("-p", "--python", default="/usr/bin/python2.6",
parser.add_option("-p", "--python", default="/usr/bin/python2.7",
help="Python interpreter to use")
parser.add_option("-d", "--deprecations", default=False,
help="Show deprecation warnings")

Просмотреть файл

@ -1,43 +0,0 @@
#!/usr/bin/python2.6
"""Makes sure mod_wsgi has been restarted after the last code push i.e,
mod_wsgi is fresher than the mtime on all *.py files in the application dir.
"""
from datetime import datetime
from optparse import OptionParser
import os
from subprocess import PIPE, Popen
import urllib2
def check_modwsgi(app_dir):
find_ = Popen("find %s -name '*.py'" % app_dir,
stdout=PIPE, shell=True).communicate()[0]
py_files = find_.strip().split("\n")
newest_mtime = max((os.stat(f).st_mtime, f) for f in py_files)
req = urllib2.Request("http://localhost:81/z/services/loaded",
headers={'Host': 'addons.mozilla.org'})
mod_wsgi = datetime.strptime(urllib2.urlopen(req).read().strip(),
'%Y-%m-%d %H:%M:%S.%f')
if mod_wsgi < datetime.fromtimestamp(newest_mtime[0]):
print("CRITICAL: %s is newer than modwsgi (restart apache)" %
newest_mtime[1])
return 2
else:
print "OK: mod_wsgi is fresh"
return 0
if __name__ == "__main__":
parser = OptionParser()
parser.add_option(
'-d', '--app_dir',
help="directory of mod_wsgi app e.g., "
"/data/amo_python/www/prod/zamboni")
options, args = parser.parse_args()
exit(check_modwsgi(options.app_dir))