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

Samantha N. Bueno sbueno+anaconda at redhat.com
Mon Jun 15 23:26:48 UTC 2015


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)

>  
>          self.diskImages = {}
>          images = getattr(conf, "diskImages", {})
> -- 
> 1.9.3
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches


More information about the anaconda-patches mailing list