From 6c903d0c62fc95765223557418db1d2fbcdf3a11 Mon Sep 17 00:00:00 2001 From: Carlos Konstanski Date: Wed, 8 Nov 2017 16:35:23 -0700 Subject: swallow file delete error if file doesn't exist --- libs/glance.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/glance.py b/libs/glance.py index 3adf64b..2de0dac 100644 --- a/libs/glance.py +++ b/libs/glance.py @@ -42,7 +42,10 @@ class Glance(object): image = self.find(image_name) if image: data = self.glance.images.data(image.id) - os.remove(file_path) + try: + os.remove(file_path) + except Exception: + pass with open(file_path, "w") as stream: for chunk in data: stream.write(chunk) -- cgit v1.3