mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't mark files that already were deleted as errors
Also use six.iteritems()
This commit is contained in:
parent
51d88a16c8
commit
0918311330
1 changed files with 5 additions and 2 deletions
|
@ -14,6 +14,7 @@ from __future__ import absolute_import
|
|||
|
||||
# Import python libs
|
||||
import copy
|
||||
import errno
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
|
@ -1614,10 +1615,12 @@ def latest(name,
|
|||
try:
|
||||
salt.utils.rm_rf(target_path)
|
||||
except OSError as exc:
|
||||
removal_errors[target_path] = exc
|
||||
if exc.errno != errno.ENOENT:
|
||||
removal_errors[target_path] = exc
|
||||
if removal_errors:
|
||||
err_strings = [
|
||||
' {0}\n {1}'.format(k, v) for k, v in removal_errors.items()
|
||||
' {0}\n {1}'.format(k, v)
|
||||
for k, v in six.iteritems(removal_errors)
|
||||
]
|
||||
return _fail(
|
||||
ret,
|
||||
|
|
Loading…
Add table
Reference in a new issue