[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] Don't add leading directory for files twice. (#503830)



On Wed, 2009-06-03 at 13:45 -0400, Chris Lumens wrote:
> > @@ -2798,6 +2798,9 @@ class FileDevice(StorageDevice):
> >          if status: 
> >              # this is the actual active mountpoint
> >              root = self.parents[0].format._mountpoint
> > +            # trim the mountpoint down to the chroot since we already have
> > +            # the otherwise fully-qualified path
> > +            root = root[:-len(self.parents[0].format.mountpoint)]
> >  
> >          return os.path.normpath("%s/%s" % (root, path))
> 
> Why mountpoint vs. _mountpoint?

See the comment just under "if status" -- a FileSystem sets
self._mountpoint when mounting the filesystem so we know what the
current mountpoint is. This is because of chroots and such, so we don't
blindly assume it's been mounted at self.mountpoint (sometimes
self.mountpoint isn't even set IIRC).

So for a device whose mountpoint is /home, but which is currently
mounted on /mnt/sysimage/home, self._mountpoint will
be /mnt/sysimage/home while self.mountpoint will still be /home.

Dave

> 
> - Chris
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list redhat com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]