mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
refactor: use relpath instead of do it manually
This commit is contained in:
parent
d3060a51a3
commit
8924b5a911
1 changed files with 2 additions and 2 deletions
|
@ -397,7 +397,7 @@ def _clean_dir(root, keep, exclude_pat):
|
|||
# -- check if this is a part of exclude_pat(only). No need to
|
||||
# check include_pat
|
||||
if not salt.utils.check_include_exclude(
|
||||
nfn[len(root) + 1:], None, exclude_pat):
|
||||
os.path.relpath(nfn, root), None, exclude_pat):
|
||||
continue
|
||||
removed.add(nfn)
|
||||
if not __opts__['test']:
|
||||
|
@ -408,7 +408,7 @@ def _clean_dir(root, keep, exclude_pat):
|
|||
# -- check if this is a part of exclude_pat(only). No need to
|
||||
# check include_pat
|
||||
if not salt.utils.check_include_exclude(
|
||||
nfn[len(root) + 1:], None, exclude_pat):
|
||||
os.path.relpath(nfn, root), None, exclude_pat):
|
||||
continue
|
||||
removed.add(nfn)
|
||||
if not __opts__['test']:
|
||||
|
|
Loading…
Add table
Reference in a new issue