[rhinstaller/blivet/pulls/111 master] Store vendor/model information for DiskDevice instances.

mulkieran installerbot-noreply at redhat.com
Mon May 11 12:57:27 UTC 2015


> @@ -476,12 +476,10 @@ def addUdevDiskDevice(self, info):
>          serial = udev.device_get_serial(info)
>          bus = udev.device_get_bus(info)
>  
> -        # udev doesn't always provide a vendor.
> -        vendor = udev.device_get_vendor(info)
> -        if not vendor:
> -            vendor = ""
> +        vendor = util.get_sysfs_attr(sysfs_path, "device/vendor")
> +        model = util.get_sysfs_attr(sysfs_path, "device/model")

Given that ```get_sysfs_attr()``` can, in theory, return None, appending ```or ""``` to the above two lines is necessary to be consistent with goal of always using empty str to represent no value for vendor and model.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/111#discussion_r30035236


More information about the anaconda-patches mailing list