From 1b8b54f84fe6a23e531eb7a55528677b1fb18054 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 May 2012 17:21:58 +0200 Subject: [PATCH] use os.umask locally Signed-off-by: Nico Schottelius --- lib/cdist/exec/local.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cdist/exec/local.py b/lib/cdist/exec/local.py index d3c6a0ce..8c9ef209 100644 --- a/lib/cdist/exec/local.py +++ b/lib/cdist/exec/local.py @@ -60,6 +60,9 @@ class Local(object): self.log = logging.getLogger(self.target_host) + # Setup file permissions using umask + os.umask(0o700) + def create_directories(self): self.mkdir(self.out_path) self.mkdir(self.global_explorer_out_path) @@ -73,8 +76,7 @@ class Local(object): def mkdir(self, path): """Create directory on the local side.""" self.log.debug("Local mkdir: %s", path) - # FIXME: dont set mode here, fix unittest mkdtemp instead - os.makedirs(path, mode=0o700, exist_ok=True) + os.makedirs(path, exist_ok=True) def run(self, command, env=None, return_output=False): """Run the given command with the given environment.