aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-07-01 12:08:11 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-07-01 12:08:11 -0400
commitb07cf871939ce5dfea8e8a145ebca39c95e07439 (patch)
tree997077ac10e5bf5168634de2c5668660e88125f1 /grs/Seed.py
parentgrs/Kernel.py: don't fail if kernel image dir exists. (diff)
downloadgrss-b07cf871939ce5dfea8e8a145ebca39c95e07439.tar.gz
grss-b07cf871939ce5dfea8e8a145ebca39c95e07439.tar.bz2
grss-b07cf871939ce5dfea8e8a145ebca39c95e07439.zip
Clean up makedirs().
makedirs() exist_ok=True. Use it to avoid FileExistsError. We are now logging exceptions vi stderr in Daemon.py, so let exceptions propagate up for debugging.
Diffstat (limited to 'grs/Seed.py')
-rw-r--r--grs/Seed.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/grs/Seed.py b/grs/Seed.py
index 0da8354..76034cc 100644
--- a/grs/Seed.py
+++ b/grs/Seed.py
@@ -50,8 +50,9 @@ class Seed():
if os.path.isdir(directory):
shutil.move(directory, '%s.0' % directory)
# Now that all prevous directory are out of the way,
- # create a new empty directory
- os.makedirs(directory)
+ # create a new empty directory. Fail if the directory
+ # is still around.
+ os.makedirs(directory, mode=0o755, exist_ok=False)
# Download a stage tarball if we don't have one
if not os.path.isfile(self.filepath):