Ommit using os.path.relpath
authorNikos Skalkotos <skalkoto@grnet.gr>
Sat, 26 Jan 2013 13:57:53 +0000 (15:57 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Sat, 26 Jan 2013 13:57:53 +0000 (15:57 +0200)
The method has different behaviour in python 2.6 and python 2.7.
In python 2.6, os.path.relpath('/proc', '/) will output '../proc'
where in python 2.7 it will output 'proc'.

image_creator/bundle_volume.py

index 3eb810a..56d4a78 100644 (file)
@@ -385,8 +385,7 @@ class BundleVolume(object):
                 rsync = Rsync(self.out)
 
                 # Excluded paths need to be relative to the source
-                for excl in map(lambda p: os.path.relpath(p, '/'),
-                                excluded + [image]):
+                for excl in map(lambda p: p[1:], excluded + [image]):
                     rsync.exclude(excl)
 
                 rsync.archive().hard_links().xattrs().sparse().acls()