Merge "Only copy symlinks when merge and preserve_properties are set"

This commit is contained in:
Jenkins 2017-07-17 17:39:16 +00:00 committed by Gerrit Code Review
commit 14885f1f2b

View File

@ -75,7 +75,7 @@ class ConfigFile(object):
self._delete_path(dest)
# dest endswith / means copy the <source> to <dest> folder
LOG.info('Copying %s to %s', source, dest)
if os.path.islink(source):
if self.merge and self.preserve_properties and os.path.islink(source):
link_target = os.readlink(source)
os.symlink(link_target, dest)
else: