summaryrefslogtreecommitdiff
path: root/src/leap/config/baseconfig.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-13 10:21:15 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-13 10:21:15 -0300
commit12d2835c7d1f3c3d11eaa587b2196c104e6859e7 (patch)
tree47dd63b13781ae3d54fc3e26669d17489b5af7a0 /src/leap/config/baseconfig.py
parentb15f28b73afc31fd4176bee1a615e4095b0f4479 (diff)
Add mkdir_p method to util.files
Diffstat (limited to 'src/leap/config/baseconfig.py')
-rw-r--r--src/leap/config/baseconfig.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/leap/config/baseconfig.py b/src/leap/config/baseconfig.py
index 0386c294..538a47f0 100644
--- a/src/leap/config/baseconfig.py
+++ b/src/leap/config/baseconfig.py
@@ -22,7 +22,6 @@ Implements the abstract base class for configuration
import logging
import functools
import os
-import errno
import copy
from abc import ABCMeta, abstractmethod
@@ -30,6 +29,7 @@ from abc import ABCMeta, abstractmethod
from leap.config.prefixers import get_platform_prefixer
from leap.config.pluggableconfig import PluggableConfig
from leap.util.check import leap_assert
+from leap.util.files import mkdir_p
logger = logging.getLogger(__name__)
@@ -92,13 +92,7 @@ class BaseConfig:
@return: True if saved to disk correctly, False otherwise
"""
config_path = os.path.join(self.get_path_prefix(), *(path_list[:-1]))
- try:
- os.makedirs(config_path)
- except OSError as e:
- if e.errno == errno.EEXIST and os.path.isdir(config_path):
- pass
- else:
- raise
+ mkdir_p(config_path)
try:
self._config_checker.serialize(os.path.join(config_path,