Просмотр исходного кода

fix warning on file.managed without changes

[WARNING ] State for file: /etc/apt/preferences - Neither 'source' nor
'contents' nor 'contents_pillar' nor 'contents_grains' was defined, yet
'replace' was set to 'True'. As there is no source to replace the file
with, 'replace' has been set to 'False' to avoid reading the file
unnecessarily.

Now, if file.managed, but when content is not changed (no source,
contents, ...), avoid the warning.
tags/v0.7.0
Adrien "ze" Urban 6 лет назад
Родитель
Сommit
c2801cc47a
2 измененных файлов: 7 добавлений и 3 удалений
  1. +5
    -3
      apt/preferences.sls
  2. +2
    -0
      apt/repositories.sls

+ 5
- 3
apt/preferences.sls Просмотреть файл

@@ -7,13 +7,15 @@
{% set default_url = apt.get('default_url', apt_map.default_url) %}

/etc/apt/preferences:
{% if remove_preferences %}
file.absent
{% else %}
file.managed:
- mode: '0644'
- user: root
- group: root
{% if remove_preferences %}
- contents: ''
- contents_newline: False
{% else %}
- replace: False
{% endif %}

{{ preferences_dir }}:

+ 2
- 0
apt/repositories.sls Просмотреть файл

@@ -18,6 +18,8 @@
{% if remove_sources_list %}
- contents: ''
- contents_newline: False
{% else %}
- replace: False
{% endif %}

{{ sources_list_dir }}:

Загрузка…
Отмена
Сохранить