diff options
author | Neil Williams <codehelp@debian.org> | 2015-11-05 14:39:41 +0000 |
---|---|---|
committer | Neil Williams <codehelp@debian.org> | 2015-11-05 14:39:41 +0000 |
commit | 0df079707118df72ba1131f53ace18d1561e0d17 (patch) | |
tree | 08a037cafc1ca3dd3d65b693e8d54fb91736dddb /vmdebootstrap/base.py | |
parent | e5987ce7b617b36935aeea406145078981fc1dca (diff) | |
download | vmdebootstrap-0df079707118df72ba1131f53ace18d1561e0d17.tar.gz |
Move copy_file functionality into base.
Diffstat (limited to 'vmdebootstrap/base.py')
-rw-r--r-- | vmdebootstrap/base.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vmdebootstrap/base.py b/vmdebootstrap/base.py index 279e5bc..0a302a4 100644 --- a/vmdebootstrap/base.py +++ b/vmdebootstrap/base.py @@ -22,6 +22,7 @@ import os import crypt +import shutil import cliapp import logging import subprocess @@ -74,6 +75,15 @@ def delete_password(rootdir, user): runcmd(['chroot', rootdir, 'passwd', '-d', user]) +def copy_files(src, dest): + for filename in os.listdir(src): + if os.path.isdir(filename) or os.path.islink(filename): + continue + shutil.copyfile( + os.path.join(src, filename), + os.path.join(dest, filename)) + + class Base(object): name = 'base' |