1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-02-04 05:47:00 +03:00

Merge pull request #187 from altlinux/fix_delete_action_file_cp

appliers/file_cp.py: fix file delete for substitutions
This commit is contained in:
Evgeny Sinelnikov 2022-12-29 03:13:16 +04:00 committed by GitHub
commit 3fb3f2e857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,7 +127,7 @@ class Files_cp:
def _delete_action(self):
list_target = [self.targetPath.name]
if self.is_pattern(self.targetPath.name):
if self.is_pattern(self.targetPath.name) and self.targetPath.parent.exists() and self.targetPath.parent.is_dir():
list_target = fnmatch.filter([str(x.name) for x in self.targetPath.parent.iterdir() if x.is_file()], self.targetPath.name)
logdata = dict()
for targetFile in list_target: