Merge lp:~joetalbott/britney/makedirs_fix into lp:~canonical-ci-engineering/britney/boottesting-support

Proposed by Joe Talbott
Status: Merged
Merged at revision: 453
Proposed branch: lp:~joetalbott/britney/makedirs_fix
Merge into: lp:~canonical-ci-engineering/britney/boottesting-support
Diff against target: 13 lines (+2/-1)
1 file modified
boottest.py (+2/-1)
To merge this branch: bzr merge lp:~joetalbott/britney/makedirs_fix
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+248682@code.launchpad.net

Commit message

boottest - Fix makedirs for existing paths

Description of the change

boottest - Fix makedirs for existing paths

To post a comment you must log in.
lp:~joetalbott/britney/makedirs_fix updated
453. By Joe Talbott

boottest - Only make the manifest directory if it doesn't already exist.

Revision history for this message
Celso Providelo (cprov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'boottest.py'
2--- boottest.py 2015-02-04 21:25:36 +0000
3+++ boottest.py 2015-02-04 21:38:03 +0000
4@@ -79,7 +79,8 @@
5 # Only [re]create the manifest file if one was successfully downloaded
6 # this allows for an existing image to be used if the download fails.
7 if response.code == 200:
8- os.makedirs(os.path.dirname(self.path))
9+ if not os.path.exists(os.path.dirname(self.path)):
10+ os.makedirs(os.path.dirname(self.path))
11 with open(self.path, 'w') as fp:
12 fp.write(response.read())
13 success = True

Subscribers

People subscribed via source and target branches