From 4e4d648593305836944dfa10811054df7ae7427e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 11 Sep 2011 20:18:30 +0200 Subject: [PATCH] fchmod() does not work on object returned by open(), so use chmod Signed-off-by: Nico Schottelius --- bin/cdist | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/cdist b/bin/cdist index e76ecfc7..09cb9d45 100755 --- a/bin/cdist +++ b/bin/cdist @@ -514,14 +514,10 @@ class Cdist: outfile_fd = open(outfile, "w") self.shell_run_or_debug_fail(bin, [bin], env=env, stdout=outfile_fd) - - a = outfile_fd - b = stat.S_IXUSR | stat.S_IRUSR | stat.S_IWUSR - print(type(a), type(b)) - - os.fchmod(outfile_fd, stat.S_IXUSR | stat.S_IRUSR | stat.S_IWUSR) outfile_fd.close() + os.chmod(outfile, stat.S_IXUSR | stat.S_IRUSR | stat.S_IWUSR) + if mode == "code": # paths = self.object_code_paths(cdist_object) local_dir = self.object_dir(cdist_object)