Merge pull request #38 from blueboxgroup/safe-config-copy

Use distutils copy_tree instead of shutil.copytree
This commit is contained in:
Paul Czarkowski 2015-04-15 09:46:05 -05:00
commit df3a953a79
1 changed files with 2 additions and 4 deletions

View File

@ -14,6 +14,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
import distutils.dir_util
import logging
import os
import shutil
@ -108,10 +109,7 @@ class PackageBuilder(Builder):
else:
LOG.debug("Copying config from '%s' to '%s'", src_config,
dest_config)
if not os.path.exists(dest_config):
shutil.copytree(src_config, dest_config)
else:
shutil.copy2(src_config, dest_config)
distutils.dir_util.copy_tree(src_config, dest_config)
if spec.settings.gerrit_dependencies:
self._install_gerrit_dependencies(repo, project, install_path)