Re: [PATCH 04/14] Add a vendor getting udev method, though udev doesn't always know it.

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

 



> >diff --git a/storage/devicetree.py b/storage/devicetree.py
> >index 7fb9f47..6090dd3 100644
> >--- a/storage/devicetree.py
> >+++ b/storage/devicetree.py
> >@@ -1166,6 +1166,13 @@ class DeviceTree(object):
> >          uuid = udev_device_get_uuid(info)
> >          sysfs_path = udev_device_get_sysfs_path(info)
> >          serial = udev_device_get_serial(info)
> >+
> >+        try:
> >+            # udev doesn't always provide a vendor.
> >+            vendor = udev_device_get_vendor(info)
> >+        except KeyError:
> >+            vendor = ""
> >+
> >          device = None
> >
> >          kwargs = {}
> 
> udev_device_get_vendor, does a get() on the info dict, so if
> the key is not there it will return None (and won't raise a keyerror)
> Assuming we want vendor to always be a string, and never none, the above
> or udev_device_get_vendor() needs to be changed.

udev_device_get_* methods in general just do a get(), so I need to
adjust the caller here.  I think None and "" end up the same in the UI,
but it could result in problems later on when processing the value.

- Chris

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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux