Support files in the layout root
Project: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/commit/aa999b54 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/tree/aa999b54 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/diff/aa999b54 Branch: refs/heads/master Commit: aa999b5494af1f295b0bfb5b7d51543994497dc3 Parents: b1272f3 Author: Thomas Jackson <[email protected]> Authored: Tue Jan 6 18:15:36 2015 -0800 Committer: Thomas Jackson <[email protected]> Committed: Tue Jan 6 18:15:36 2015 -0800 ---------------------------------------------------------------------- tsqa/environment.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/aa999b54/tsqa/environment.py ---------------------------------------------------------------------- diff --git a/tsqa/environment.py b/tsqa/environment.py index 24d432f..fb97bc7 100644 --- a/tsqa/environment.py +++ b/tsqa/environment.py @@ -284,11 +284,16 @@ class Environment: # copy all files from old layout to new one for item in os.listdir(layout.prefix): - shutil.copytree(os.path.join(layout.prefix, item), - os.path.join(self.layout.prefix, item), - symlinks=True, - ignore=None, - ) + src_path = os.path.join(layout.prefix, item) + dst_path = os.path.join(self.layout.prefix, item) + if os.path.isdir(src_path): + shutil.copytree(src_path, + dst_path, + symlinks=True, + ignore=None, + ) + elif os.path.isfile(src_path): + shutil.copyfile(src_path, dst_path) # make sure that all suffixes in new layout exist for name in self.layout.suffixes:
