Projet

Général

Profil

0001-debian-run-hobo-hobo-agent-with-python-3-41640.patch

Frédéric Péters, 13 avril 2020 13:57

Télécharger (5,44 ko)

Voir les différences:

Subject: [PATCH] debian: run hobo & hobo-agent with python 3 (#41640)

 debian/agent/hobo-agent.conf                  |  2 +-
 debian/control                                | 21 +++++++++++--------
 ...thon-hobo.install => python3-hobo.install} |  0
 debian/rules                                  |  4 ++--
 debian/server/debian_config.py                |  8 +++----
 debian/server/hobo-manage                     |  5 ++---
 debian/server/uwsgi.ini                       |  2 +-
 manage.py                                     |  2 +-
 8 files changed, 23 insertions(+), 21 deletions(-)
 rename debian/{python-hobo.install => python3-hobo.install} (100%)
debian/agent/hobo-agent.conf
1 1
[program:hobo-agent]
2 2
; Concurrency set to 1 because there is no lock around calls to hobo_notify
3
command=python2.7 /usr/bin/celery worker --hostname=agent.%%h --app=hobo.agent.worker --loglevel=INFO --concurrency=1 --maxtasksperchild=100
3
command=python3 /usr/bin/celery worker --hostname=agent.%%h --app=hobo.agent.worker --loglevel=INFO --concurrency=1 --maxtasksperchild=100
4 4
environment=HOBO_AGENT_SETTINGS_FILE="/etc/hobo-agent/settings.py"
5 5
process_name=hobo-agent
6 6
user=hobo-agent
debian/control
9 9
Architecture: all
10 10
Depends: ${misc:Depends},
11 11
    ${python:Depends},
12
    python3-hobo (= ${binary:Version}),
12 13
    python-django (>= 1:1.11),
13 14
    python-celery (>= 3.1.13),
14 15
    python-requests,
......
37 38
    python3-djangorestframework,
38 39
    python3-dnspython,
39 40
    python3-systemd
41
Breaks: python-hobo (<< 1.51.post2)
42
Replaces: python-hobo (<< 1.51.post2)
40 43
Recommends:
41 44
    python3-gadjo,
42 45
    python3-django-mellon (>= 1.2.22.26),
......
45 48

  
46 49
Package: hobo
47 50
Architecture: all
48
Depends: python-hobo (= ${binary:Version}),
49
    python-django-tenant-schemas,
50
    python-psycopg2,
51
    python-django (>= 1.8),
52
    python-gadjo,
53
    python-django-mellon (>= 1.2.17),
51
Depends: python3-hobo (= ${binary:Version}),
52
    python3-django-tenant-schemas,
53
    python3-psycopg2,
54
    python3-django (>= 1.8),
55
    python3-gadjo,
56
    python3-django-mellon (>= 1.2.17),
54 57
    uwsgi,
55
    uwsgi-plugin-python
58
    uwsgi-plugin-python3
56 59
Recommends: nginx,
57 60
    rabbitmq-server (>= 3.3),
58 61
    erlang-nox (>= 1:17.1)
......
61 64

  
62 65
Package: hobo-agent
63 66
Architecture: all
64
Depends: python-hobo (= ${binary:Version}),
65
    python-celery-common,
67
Depends: python3-hobo (= ${binary:Version}),
68
    python3-celery-common,
66 69
    sudo,
67 70
    supervisor
68 71
Description: Rapid Remote Deployment Agent
debian/rules
12 12

  
13 13
override_dh_install:
14 14
	dh_install
15
	mv $(PYTHON_HOBO_DIR)/usr/bin/manage.py $(PYTHON_HOBO_DIR)/usr/lib/hobo/manage.py
16
	rm $(PYTHON3_HOBO_DIR)/usr/bin/manage.py
15
	mv $(PYTHON3_HOBO_DIR)/usr/bin/manage.py $(PYTHON3_HOBO_DIR)/usr/lib/hobo/manage.py
16
	rm $(PYTHON_HOBO_DIR)/usr/bin/manage.py
debian/server/debian_config.py
1
# This file is sourced by "execfile" from hobo.settings
1
# This file is sourced by "exec" from hobo.settings
2 2

  
3 3
import os
4 4

  
5 5
PROJECT_NAME = 'hobo'
6
execfile('/usr/lib/hobo/debian_config_common.py')
6
exec(open('/usr/lib/hobo/debian_config_common.py').read())
7 7

  
8 8
# hobo don't use multitenant mellon adapter: IdP is detected in the local
9 9
# environnment
......
13 13
# add custom hobo agent module
14 14
INSTALLED_APPS = ('hobo.agent.hobo', ) + INSTALLED_APPS
15 15

  
16
execfile(os.path.join(ETC_DIR, 'settings.py'))
16
exec(open(os.path.join(ETC_DIR, 'settings.py')).read())
17 17

  
18 18
# run additional settings snippets
19
execfile('/usr/lib/hobo/debian_config_settings_d.py')
19
exec(open('/usr/lib/hobo/debian_config_settings_d.py').read())
debian/server/hobo-manage
18 18

  
19 19
if test $# -eq 0
20 20
then
21
    python ${MANAGE} help
21
    python3 ${MANAGE} help
22 22
    exit 1
23 23
fi
24 24

  
25
python ${MANAGE} "$@"
26

  
25
python3 ${MANAGE} "$@"
debian/server/uwsgi.ini
2 2
auto-procname = true
3 3
procname-prefix-spaced = hobo
4 4

  
5
plugin = python
5
plugin = python3
6 6
module = hobo.wsgi:application
7 7

  
8 8
http-socket = /run/hobo/hobo.sock
manage.py
1
#!/usr/bin/env python
1
#!/usr/bin/env python3
2 2
import os
3 3
import sys
4 4

  
5
-