another fix for file defined w/ id, but require name

for following sls:

 /root/a:
   file.directory:
     - user: root
     - group: root
     - mode: 0755
     - clean: True
     - require:
         - file: /root/a/b
         - file: /root/a/c

 /root/a/b:
   file.directory:
     - user: root
     - group: root
     - mode: 0755

 id_test:
   file.managed:
     - name: /root/a/c
     - user: root
     - group: root
     - mode: 0755
     - replace: False
This commit is contained in:
Z. Liu 2015-05-07 16:20:02 +08:00
parent 58d359ee6e
commit fe43c66997

View File

@ -349,7 +349,7 @@ def _gen_keep_files(name, require):
required_files = [comp for comp in require if 'file' in comp]
for comp in required_files:
for low in __lowstate__:
if low['__id__'] == comp['file']:
if comp['file'] in (low['__id__'], low['name']):
fn = low['name']
if os.path.isdir(comp['file']):
if _is_child(comp['file'], name):