浏览代码

fix(vhosts/cleanup): check `sites-enabled` dir exists before listing it

Co-authored-by: Tristan Charbonneau <tcharbonneau@oceanet-technology.com>

Fix #278
tags/v0.39.5
Yoda-BZH 4 年前
父节点
当前提交
88373e38f5
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. +6
    -4
      apache/vhosts/cleanup.sls

+ 6
- 4
apache/vhosts/cleanup.sls 查看文件

@@ -21,8 +21,9 @@ include:
{% endfor %}


{% for filename in salt['file.readdir']('/etc/apache2/sites-enabled/') %}
{% if filename not in valid_sites %}
{% if salt['file.directory_exists'](dirpath) %}
{% for filename in salt['file.readdir'](dirpath) %}
{% if filename not in valid_sites %}

a2dissite {{ filename }}:
cmd.run:
@@ -34,8 +35,9 @@ a2dissite {{ filename }}:
- module: apache-reload
- service: apache

{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}


{% endif %}{# Debian #}

正在加载...
取消
保存