[blivet][PATCH][f21] Wait for udev to settle before collecting UUID for new filesystems.

Vratislav Podzimek vpodzime at redhat.com
Mon Oct 27 06:37:26 UTC 2014


On Fri, 2014-10-24 at 18:48 -0400, Anne Mulhern wrote:
> 
> 
> 
> ----- Original Message -----
> > From: "David Lehman" <dlehman at redhat.com>
> > To: anaconda-patches at lists.fedorahosted.org
> > Sent: Friday, October 24, 2014 5:32:49 PM
> > Subject: [blivet][PATCH][f21] Wait for udev to settle before collecting UUID	for new filesystems.
> > 
> > The consequence of the bug is that we end up putting paths into
> > /etc/fstab instead of UUIDs. That happens because as far as we can tell
> > there is no UUID because, well, udev told us there was no UUID.
> > 
> > Related: rhbz#1156614
> > ---
> >  blivet/deviceaction.py | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py
> > index 914e8d1..22b3cd8 100644
> > --- a/blivet/deviceaction.py
> > +++ b/blivet/deviceaction.py
> > @@ -558,6 +558,7 @@ class ActionCreateFormat(DeviceAction):
> >  
> >          self.device.format.create(device=self.device.path,
> >                                    options=self.device.formatArgs)
> > +        udev.settle()
> 
> In a bright future we should figure out a way of waiting more
> cleverly, but for now this looks like the right thing to do,
> so ack.
I'm not sure udev is clever enough to allow us waiting more cleverly,
but one thing has come to my mind seeing this change: 

What about 'with udev_settle(pre=True, post=True)' context manager? It
wouldn't bring (big) +/- lines improvement, but it would make the settle
action and the "settled" block more visible and tweaking the settle code
in the future would only require changes in one place.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list