Skip to content

Commit 16fa5c4

Browse files
authored
fix(hg): add file branch for wsgi file (#430)
* fix(hg): add branches for noble * fix(hg): add file branch for py3
1 parent bc00ae9 commit 16fa5c4

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

salt/hg/files/hg/wsgi/python.wsgi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,4 @@ from mercurial import encoding
33

44
CONFIG = '/srv/hg/repos.conf'
55
encoding.encoding = 'utf-8'
6-
{% if grains["oscodename"] == "noble" %}
7-
application = hgwebdir(CONFIG.encode())
8-
{% else %}
96
application = hgwebdir(CONFIG)
10-
{% endif %}
11-

salt/hg/files/hg/wsgi/python3.wsgi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from mercurial.hgweb.hgwebdir_mod import hgwebdir
2+
from mercurial import encoding
3+
4+
CONFIG = '/srv/hg/repos.conf'
5+
encoding.encoding = 'utf-8'
6+
application = hgwebdir(CONFIG.encode())

salt/hg/init.sls

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@ hg-user:
5858
- file_mode: "0755"
5959
- require:
6060
- user: hg-user
61+
- exclude_pat:
62+
- python*.wsgi
63+
64+
{% if grains["oscodename"] == "noble" %}
65+
/srv/hg/wsgi/python3.wsgi:
66+
file.managed:
67+
- source: salt://hg/files/hg/wsgi/python3.wsgi
68+
- user: hg
69+
- mode: "0755"
70+
- require:
71+
- file: /srv/hg/wsgi
72+
{% else %}
73+
/srv/hg/wsgi/python.wsgi:
74+
file.managed:
75+
- source: salt://hg/files/hg/wsgi/python.wsgi
76+
- user: hg
77+
- mode: "0755"
78+
- require:
79+
- file: /srv/hg/wsgi
80+
{% endif %}
6181

6282
/srv/hg/src:
6383
file.recurse:

0 commit comments

Comments
 (0)