From f63896045f137e2b0e917b239cca8fb5dee4b00a Mon Sep 17 00:00:00 2001 From: Joe Talbott Date: Wed, 4 Feb 2015 16:42:08 -0500 Subject: [PATCH] boottest - Only make the manifest directory if it doesn't already exist. --- boottest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boottest.py b/boottest.py index 1ae180e..3ec0ddd 100644 --- a/boottest.py +++ b/boottest.py @@ -79,7 +79,8 @@ class TouchManifest(object): # Only [re]create the manifest file if one was successfully downloaded # this allows for an existing image to be used if the download fails. if response.code == 200: - os.makedirs(os.path.dirname(self.path)) + if not os.path.exists(os.path.dirname(self.path)): + os.makedirs(os.path.dirname(self.path)) with open(self.path, 'w') as fp: fp.write(response.read()) success = True