From aaef55c007c4bf4b1e9ccc4ccc49920cc4bb1d84 Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Wed, 14 Jul 2010 15:57:19 +0200 Subject: [PATCH] Fix file trees copying Create the directories in advance to copying files, not later, becase this caused some destination path problems, like not appending the filename to the destination directory, because it didn't exist. --- src/pylorax/sysutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pylorax/sysutils.py b/src/pylorax/sysutils.py index 232f6ddd..1a6548a1 100644 --- a/src/pylorax/sysutils.py +++ b/src/pylorax/sysutils.py @@ -234,8 +234,8 @@ class SmartCopy(object): self.__copy_link(src_path, dst_path, src, new_dst, dir=True) else: # create the destination directory - if not os.path.isdir(new_dst) and new_dst not in self.makedirs: - self.makedirs.append(new_dst) + if not os.path.isdir(new_dst): + makedirs_(new_dst) elif os.path.isfile(new_dst): err_msg = "cannot overwrite file '{0}' with directory" err_msg = err_msg.format(new_dst)