summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-08-04 11:18:05 +0000
committerSam Thursfield <sam@afuera.me.uk>2014-09-05 13:00:21 +0000
commitb08fe72ddf1b1ba8ba1779b7ef084b3dbf2d478a (patch)
tree682ba2942abf5b75c58e7479da886ea3b0459f86
parenta4da163c6b349cfc56b1c4a4c8cb25d85a445974 (diff)
downloadmorph-b08fe72ddf1b1ba8ba1779b7ef084b3dbf2d478a.tar.gz
docker.write: Fix wrong symlink paths in the system tarball
This was causing an error when deploying systems that contained symlinks.
-rwxr-xr-xmorphlib/exts/docker.write3
1 files changed, 2 insertions, 1 deletions
diff --git a/morphlib/exts/docker.write b/morphlib/exts/docker.write
index bc9f9d0b..90ce3e69 100755
--- a/morphlib/exts/docker.write
+++ b/morphlib/exts/docker.write
@@ -302,7 +302,8 @@ class DockerWriteExtension(morphlib.writeexts.WriteExtension):
tarinfo.name = os.path.relpath(old_name, fs_root)
#print 'Tarinfo name %s, from path %s root %s' % (tarinfo.name, old_name, fs_root)
if tarinfo.islnk():
- tarinfo.linkname = os.path.relpath(tarinfo.linkname, fs_root)
+ old_linkname = os.path.join('/', tarinfo.linkname)
+ tarinfo.linkname = os.path.relpath(old_linkname, fs_root)
return tarinfo
try: