summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2016-07-17 15:25:57 +0100
committerNeil Williams <codehelp@debian.org>2016-07-17 15:25:57 +0100
commit467113fd8932218b0ea5700aa9d39077b09aeedd (patch)
treef37622468637a4ccc70b6e135afc78cd6ba8c9f0
parent29c91afaec164c9ed6d2f7e237c7fcb2748c77fc (diff)
downloadvmdebootstrap-467113fd8932218b0ea5700aa9d39077b09aeedd.tar.gz
fixup copy_files to skip directories in the specified src directory.
-rw-r--r--vmdebootstrap/base.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/vmdebootstrap/base.py b/vmdebootstrap/base.py
index 71d929e..d090f0e 100644
--- a/vmdebootstrap/base.py
+++ b/vmdebootstrap/base.py
@@ -80,10 +80,11 @@ def delete_password(rootdir, user):
def copy_files(src, dest):
for filename in os.listdir(src):
- if os.path.isdir(filename) or os.path.islink(filename):
+ src_path = os.path.join(src, filename)
+ if os.path.isdir(src_path) or os.path.islink(src_path):
continue
shutil.copyfile(
- os.path.join(src, filename),
+ src_path,
os.path.join(dest, filename))