mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
except right exception that file module raised
This commit is contained in:
parent
3a22b3af38
commit
cfb7225d2a
@ -198,6 +198,7 @@ import yaml
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
import salt.utils.templates
|
||||
from salt.exceptions import CommandExecutionError
|
||||
from salt._compat import string_types
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -838,8 +839,8 @@ def absent(name):
|
||||
ret['comment'] = 'Removed file {0}'.format(name)
|
||||
ret['changes']['removed'] = name
|
||||
return ret
|
||||
except (OSError, IOError):
|
||||
return _error(ret, 'Failed to remove file {0}'.format(name))
|
||||
except CommandExecutionError as exc:
|
||||
return _error(ret, '{0}'.format(exc))
|
||||
|
||||
elif os.path.isdir(name):
|
||||
if __opts__['test']:
|
||||
|
Loading…
Reference in New Issue
Block a user