From 7761cf9ec2937c339c7b05fdcef5a2a6b68eeb35 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 17 Mar 2016 10:38:15 +0100 Subject: [PATCH] update celery package and promt to install new init files for workers --- requirements.txt | 2 +- update.py | 31 +++++++++++++++---------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/requirements.txt b/requirements.txt index 51b28b9e0..6e92b8241 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ Django==1.9.4 simplejson chardet -celery==3.1.20 +celery==3.1.23 django-celery==3.1.17 django-extensions==1.6.1 gunicorn==19.4.5 diff --git a/update.py b/update.py index 74f631224..7a3573143 100755 --- a/update.py +++ b/update.py @@ -79,6 +79,15 @@ def check_services(base): print('\tsudo service %s start' % service) print('') +def update_service(service): + print('Please install new init script for "%s" service:' % service) + if os.path.exists('/etc/init/%s.conf'%service): + print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)) + if os.path.exists('/bin/systemctl'): + print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service)) + print('\tsudo systemctl daemon-reload') + print('\tsudo service %s restart' % service) + def run_git(path, *args): cmd = ['git'] + list(args) env = {'GIT_DIR': '%s/.git' % path} @@ -185,14 +194,7 @@ if __name__ == "__main__": shutil.rmtree('contrib') run('./bin/pip', 'install', '-r', 'requirements.txt') run('./pandora/manage.py', 'migrate', '--fake-initial', '--noinput') - service = 'pandora' - print('Please install new init script for "%s" service:' % service) - if os.path.exists('/etc/init/%s.conf'%service): - print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)) - if os.path.exists('/bin/systemctl'): - print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service)) - print('\tsudo systemctl daemon-reload') - print('\tsudo service %s restart' % service) + update_service('pandora') if old <= 5432: import pandora.settings run('./bin/pip', 'install', '-r', 'requirements.txt') @@ -209,14 +211,11 @@ if __name__ == "__main__": if '0.0.0.0:2620' in data: run('sed', '-i', 's/127.0.0.1:2620/0.0.0.0:2620/g', gunicorn_config) if old > 5389: - service = 'pandora' - print('Please install new init script for "%s" service:' % service) - if os.path.exists('/etc/init/%s.conf'%service): - print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service)) - if os.path.exists('/bin/systemctl'): - print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service)) - print('\tsudo systemctl daemon-reload') - print('\tsudo service %s restart' % service) + update_service('pandora') + if old < 5452: + run('./bin/pip', 'install', '-r', 'requirements.txt') + update_service('pandora-encoding') + update_service('pandora-tasks') else: if len(sys.argv) == 1: release = get_release()