mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
file.managed: tmp_filename needs to always be defined
This commit is contained in:
parent
0b10cead06
commit
60c250af37
@ -1472,6 +1472,8 @@ def managed(name,
|
|||||||
log.debug(traceback.format_exc())
|
log.debug(traceback.format_exc())
|
||||||
return _error(ret, 'Unable to manage file: {0}'.format(exc))
|
return _error(ret, 'Unable to manage file: {0}'.format(exc))
|
||||||
|
|
||||||
|
tmp_filename = None
|
||||||
|
|
||||||
if check_cmd:
|
if check_cmd:
|
||||||
tmp_filename = salt.utils.mkstemp()
|
tmp_filename = salt.utils.mkstemp()
|
||||||
|
|
||||||
@ -1559,7 +1561,8 @@ def managed(name,
|
|||||||
log.debug(traceback.format_exc())
|
log.debug(traceback.format_exc())
|
||||||
return _error(ret, 'Unable to manage file: {0}'.format(exc))
|
return _error(ret, 'Unable to manage file: {0}'.format(exc))
|
||||||
finally:
|
finally:
|
||||||
os.remove(tmp_filename)
|
if tmp_filename:
|
||||||
|
os.remove(tmp_filename)
|
||||||
|
|
||||||
|
|
||||||
def directory(name,
|
def directory(name,
|
||||||
|
Loading…
Reference in New Issue
Block a user