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] [program:hobo-agent]
; Concurrency set to 1 because there is no lock around calls to hobo_notify ; 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" environment=HOBO_AGENT_SETTINGS_FILE="/etc/hobo-agent/settings.py"
process_name=hobo-agent process_name=hobo-agent
user=hobo-agent user=hobo-agent

21
debian/control vendored
View File

@ -9,6 +9,7 @@ Package: python-hobo
Architecture: all Architecture: all
Depends: ${misc:Depends}, Depends: ${misc:Depends},
${python:Depends}, ${python:Depends},
python3-hobo (= ${binary:Version}),
python-django (>= 1:1.11), python-django (>= 1:1.11),
python-celery (>= 3.1.13), python-celery (>= 3.1.13),
python-requests, python-requests,
@ -37,6 +38,8 @@ Depends: ${misc:Depends},
python3-djangorestframework, python3-djangorestframework,
python3-dnspython, python3-dnspython,
python3-systemd python3-systemd
Breaks: python-hobo (<< 1.51.post3)
Replaces: python-hobo (<< 1.51.post3)
Recommends: Recommends:
python3-gadjo, python3-gadjo,
python3-django-mellon (>= 1.2.22.26), python3-django-mellon (>= 1.2.22.26),
@ -45,14 +48,14 @@ Description: Rapid Remote Deployment python 3 module
Package: hobo Package: hobo
Architecture: all Architecture: all
Depends: python-hobo (= ${binary:Version}), Depends: python3-hobo (= ${binary:Version}),
python-django-tenant-schemas, python3-django-tenant-schemas,
python-psycopg2, python3-psycopg2,
python-django (>= 1.8), python3-django (>= 1.8),
python-gadjo, python3-gadjo,
python-django-mellon (>= 1.2.17), python3-django-mellon (>= 1.2.17),
uwsgi, uwsgi,
uwsgi-plugin-python uwsgi-plugin-python3
Recommends: nginx, Recommends: nginx,
rabbitmq-server (>= 3.3), rabbitmq-server (>= 3.3),
erlang-nox (>= 1:17.1) erlang-nox (>= 1:17.1)
@ -61,8 +64,8 @@ Description: Rapid Remote Deployment Daemon
Package: hobo-agent Package: hobo-agent
Architecture: all Architecture: all
Depends: python-hobo (= ${binary:Version}), Depends: python3-hobo (= ${binary:Version}),
python-celery-common, python3-celery-common,
sudo, sudo,
supervisor supervisor
Description: Rapid Remote Deployment Agent 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: override_dh_install:
dh_install dh_install
mv $(PYTHON_HOBO_DIR)/usr/bin/manage.py $(PYTHON_HOBO_DIR)/usr/lib/hobo/manage.py mv $(PYTHON3_HOBO_DIR)/usr/bin/manage.py $(PYTHON3_HOBO_DIR)/usr/lib/hobo/manage.py
rm $(PYTHON3_HOBO_DIR)/usr/bin/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 import os
PROJECT_NAME = 'hobo' 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 # hobo don't use multitenant mellon adapter: IdP is detected in the local
# environnment # environnment
@ -13,7 +13,7 @@ MELLON_ADD_AUTHNREQUEST_NEXT_URL_EXTENSION = True
# add custom hobo agent module # add custom hobo agent module
INSTALLED_APPS = ('hobo.agent.hobo', ) + INSTALLED_APPS 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 # 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 if test $# -eq 0
then then
python ${MANAGE} help python3 ${MANAGE} help
exit 1 exit 1
fi fi
python ${MANAGE} "$@" python3 ${MANAGE} "$@"

View File

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

View File

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