From cbdc24aeef9ffbd8e7400ab43112409509b3337d Mon Sep 17 00:00:00 2001 From: Elizabeth Krumbach Date: Mon, 28 Jan 2013 15:03:49 -0800 Subject: [PATCH] Remove warning for existing output directory. In our configuration puppet will manage the output directory, so it is expected behavior for it to exist, removing warning. Also switching to distutils.dir_util copy_tree since that allows for copying of required supporting files into an existing output directory. Change-Id: I38b2c6ec47fd61814554a4b5007a83553b05aeb2 Reviewed-on: https://review.openstack.org/20647 Approved: Dan Prince Reviewed-by: Dan Prince Tested-by: Jenkins --- reviewday/util.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/reviewday/util.py b/reviewday/util.py index 00ae4f7..06d7602 100644 --- a/reviewday/util.py +++ b/reviewday/util.py @@ -1,16 +1,13 @@ import os -import shutil import html_helper from Cheetah.Template import Template +from distutils.dir_util import copy_tree def prep_out_dir(out_dir='out_report'): src_dir = os.path.dirname(__file__) report_files_dir = os.path.join(src_dir, 'report_files') - if os.path.exists(out_dir): - print 'WARNING: output directory "%s" already exists' % out_dir - else: - shutil.copytree(report_files_dir, out_dir) + copy_tree(report_files_dir, out_dir) def create_report(name_space={}):