Skip to content

Commit eb01146

Browse files
committed
Add nginx settings conditionally, as at least one of them will be added in devpi-server 6.18.0.
1 parent a3333ad commit eb01146

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ def adjust_nginx_conf_content(content):
2727
listen = re.search(r'listen \d+;', content).group(0)
2828
new_content = nginx_path.joinpath('nginx-devpi-lockdown.conf').read_text()
2929
new_content = new_content.replace('listen 80;', listen)
30-
new_content = f"proxy_temp_path tmp;\n{new_content}"
31-
new_content = f"client_body_temp_path tmp;\n{new_content}"
30+
if "proxy_temp_path" not in new_content:
31+
new_content = f"proxy_temp_path tmp;\n{new_content}"
32+
if "client_body_temp_path" not in new_content:
33+
new_content = f"client_body_temp_path tmp;\n{new_content}"
3234
return new_content
3335
return adjust_nginx_conf_content
3436

0 commit comments

Comments
 (0)