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 <dprince@redhat.com>
Reviewed-by: Dan Prince <dprince@redhat.com>
Tested-by: Jenkins
This commit is contained in:
Elizabeth Krumbach 2013-01-28 15:03:49 -08:00 committed by Jenkins
parent 932bfca9cc
commit cbdc24aeef

View File

@ -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={}):