debian: run hobo & hobo-agent with python 3 (#41640)

This commit is contained in:
Frédéric Péters 2020-04-13 13:49:38 +02:00
parent 2b0474a2e9
commit dd6d9c8b25
8 changed files with 23 additions and 21 deletions

View File

@ -1,6 +1,6 @@
[program:hobo-agent]
; Concurrency set to 1 because there is no lock around calls to hobo_notify
command=python2.7 /usr/bin/celery worker --hostname=agent.%%h --app=hobo.agent.worker --loglevel=INFO --concurrency=1 --maxtasksperchild=100
command=python3 /usr/bin/celery worker --hostname=agent.%%h --app=hobo.agent.worker --loglevel=INFO --concurrency=1 --maxtasksperchild=100
environment=HOBO_AGENT_SETTINGS_FILE="/etc/hobo-agent/settings.py"
process_name=hobo-agent
user=hobo-agent

21
debian/control vendored
View File

@ -9,6 +9,7 @@ Package: python-hobo
Architecture: all
Depends: ${misc:Depends},
${python:Depends},
python3-hobo (= ${binary:Version}),
python-django (>= 1:1.11),
python-celery (>= 3.1.13),
python-requests,
@ -37,6 +38,8 @@ Depends: ${misc:Depends},
python3-djangorestframework,
python3-dnspython,
python3-systemd
Breaks: python-hobo (<< 1.51.post3)
Replaces: python-hobo (<< 1.51.post3)
Recommends:
python3-gadjo,
python3-django-mellon (>= 1.2.22.26),
@ -45,14 +48,14 @@ Description: Rapid Remote Deployment python 3 module
Package: hobo
Architecture: all
Depends: python-hobo (= ${binary:Version}),
python-django-tenant-schemas,
python-psycopg2,
python-django (>= 1.8),
python-gadjo,
python-django-mellon (>= 1.2.17),
Depends: python3-hobo (= ${binary:Version}),
python3-django-tenant-schemas,
python3-psycopg2,
python3-django (>= 1.8),
python3-gadjo,
python3-django-mellon (>= 1.2.17),
uwsgi,
uwsgi-plugin-python
uwsgi-plugin-python3
Recommends: nginx,
rabbitmq-server (>= 3.3),
erlang-nox (>= 1:17.1)
@ -61,8 +64,8 @@ Description: Rapid Remote Deployment Daemon
Package: hobo-agent
Architecture: all
Depends: python-hobo (= ${binary:Version}),
python-celery-common,
Depends: python3-hobo (= ${binary:Version}),
python3-celery-common,
sudo,
supervisor
Description: Rapid Remote Deployment Agent

4
debian/rules vendored
View File

@ -12,5 +12,5 @@ PYTHON3_HOBO_DIR=$(CURDIR)/debian/python3-hobo
override_dh_install:
dh_install
mv $(PYTHON_HOBO_DIR)/usr/bin/manage.py $(PYTHON_HOBO_DIR)/usr/lib/hobo/manage.py
rm $(PYTHON3_HOBO_DIR)/usr/bin/manage.py
mv $(PYTHON3_HOBO_DIR)/usr/bin/manage.py $(PYTHON3_HOBO_DIR)/usr/lib/hobo/manage.py
rm $(PYTHON_HOBO_DIR)/usr/bin/manage.py

View File

@ -1,9 +1,9 @@
# This file is sourced by "execfile" from hobo.settings
# This file is sourced by "exec" from hobo.settings
import os
PROJECT_NAME = 'hobo'
execfile('/usr/lib/hobo/debian_config_common.py')
exec(open('/usr/lib/hobo/debian_config_common.py').read())
# hobo don't use multitenant mellon adapter: IdP is detected in the local
# environnment
@ -13,7 +13,7 @@ MELLON_ADD_AUTHNREQUEST_NEXT_URL_EXTENSION = True
# add custom hobo agent module
INSTALLED_APPS = ('hobo.agent.hobo', ) + INSTALLED_APPS
execfile(os.path.join(ETC_DIR, 'settings.py'))
exec(open(os.path.join(ETC_DIR, 'settings.py')).read())
# run additional settings snippets
execfile('/usr/lib/hobo/debian_config_settings_d.py')
exec(open('/usr/lib/hobo/debian_config_settings_d.py').read())

View File

@ -18,9 +18,8 @@ fi
if test $# -eq 0
then
python ${MANAGE} help
python3 ${MANAGE} help
exit 1
fi
python ${MANAGE} "$@"
python3 ${MANAGE} "$@"

View File

@ -2,7 +2,7 @@
auto-procname = true
procname-prefix-spaced = hobo
plugin = python
plugin = python3
module = hobo.wsgi:application
http-socket = /run/hobo/hobo.sock

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys