[blivet][master/rhel7-branch] Fix a traceback with anaconda-cleanup on s390x. (#1173101)

Vratislav Podzimek vpodzime at redhat.com
Tue Jun 16 07:17:52 UTC 2015


On Mon, 2015-06-15 at 19:26 -0400, Samantha N. Bueno wrote:
> On Mon, Jun 15, 2015 at 06:17:25PM -0400, Samantha N. Bueno wrote:
> > Devicetree reset crashed on s390x when calling anaconda-cleanup
> > because the dasd attribute was never created or properly set.
> 
> I should probably expand on this comment a little; anaconda-cleanup
> instantiates an instance of blivet with a StorageDiscoveryConfig
> object. This StorageDiscoveryConfig object never had any self.dasd
> attr set, which is why devicetree.reset() would fail, since it tried to
> (re)set an attr that didn't exist.
>  
> > Resolves: rhbz#1173101
> > ---
> >  blivet/__init__.py   | 1 +
> >  blivet/devicetree.py | 2 +-
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/blivet/__init__.py b/blivet/__init__.py
> > index 3b28ad9..808fd92 100644
> > --- a/blivet/__init__.py
> > +++ b/blivet/__init__.py
> > @@ -285,6 +285,7 @@ class StorageDiscoveryConfig(object):
> >          self.protectedDevSpecs = []
> >          self.diskImages = {}
> >          self.zeroMbr = False
> > +        self.dasd = []
> >  
> >          # Whether clearPartitions removes scheduled/non-existent devices and
> >          # disklabels depends on this flag.
> > diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> > index 9f1aa9e..43a1805 100644
> > --- a/blivet/devicetree.py
> > +++ b/blivet/devicetree.py
> > @@ -116,7 +116,7 @@ class DeviceTree(object):
> >          self.exclusiveDisks = getattr(conf, "exclusiveDisks", [])
> >          self.ignoredDisks = getattr(conf, "ignoredDisks", [])
> >          self.iscsi = iscsi
> > -        self.dasd = dasd
> > +        self.dasd = dasd = getattr(conf, "dasd", dasd)
> Uh, oops. So obviously when I tested this, the line read:
>            self.dasd = getattr(conf, "dasd", dasd)
Sounds and looks reasonable to me. ACK.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list