Skip to content

Commit

Permalink
fix(hg): add file branch for wsgi file (#430)
Browse files Browse the repository at this point in the history
* fix(hg): add branches for noble

* fix(hg): add file branch for py3
  • Loading branch information
JacobCoffee authored Aug 1, 2024
1 parent bc00ae9 commit 16fa5c4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
5 changes: 0 additions & 5 deletions salt/hg/files/hg/wsgi/python.wsgi
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@ from mercurial import encoding

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

6 changes: 6 additions & 0 deletions salt/hg/files/hg/wsgi/python3.wsgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial import encoding

CONFIG = '/srv/hg/repos.conf'
encoding.encoding = 'utf-8'
application = hgwebdir(CONFIG.encode())
20 changes: 20 additions & 0 deletions salt/hg/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ hg-user:
- file_mode: "0755"
- require:
- user: hg-user
- exclude_pat:
- python*.wsgi

{% if grains["oscodename"] == "noble" %}
/srv/hg/wsgi/python3.wsgi:
file.managed:
- source: salt://hg/files/hg/wsgi/python3.wsgi
- user: hg
- mode: "0755"
- require:
- file: /srv/hg/wsgi
{% else %}
/srv/hg/wsgi/python.wsgi:
file.managed:
- source: salt://hg/files/hg/wsgi/python.wsgi
- user: hg
- mode: "0755"
- require:
- file: /srv/hg/wsgi
{% endif %}

/srv/hg/src:
file.recurse:
Expand Down

0 comments on commit 16fa5c4

Please sign in to comment.