Merge "Fix removing temp file"

This commit is contained in:
Jenkins 2016-11-09 23:32:08 +00:00 committed by Gerrit Code Review
commit f320b35137
3 changed files with 4 additions and 4 deletions

View File

@ -225,7 +225,7 @@ def main():
if CONF.action not in ['start', 'stop', 'status', 'reload']:
sys.stderr.write("Using freezer-scheduler as a command line client is "
"deprecated. Please use the freezer command line tool"
" from python-freezerclient.")
" from python-freezerclient.\n")
apiclient = None
insecure = False

View File

@ -283,5 +283,4 @@ class Backup(object):
metadata_content = f.readlines()
LOG.info("metadata content download {0}".format(metadata_content))
metadata_file.close()
utils.delete_file(metadata_file.name)
return json.loads(metadata_content[0])

View File

@ -364,8 +364,9 @@ def delete_file(path_to_file):
"""
try:
os.remove(path_to_file)
except Exception:
LOG.warning("Error deleting file {0}".format(path_to_file))
except Exception as e:
LOG.warning("Error deleting file {0}:\n{1}".format(path_to_file,
str(e)))
def walk_path(path, exclude, ignorelinks, callback, *kargs, **kwargs):