[blivet:f21-branch/master 1/3] Register DeviceFormat class (#1150147)

mulhern amulhern at redhat.com
Fri Oct 10 15:25:13 UTC 2014


Related: fed#1150147

This shouldn't change any observable behavior in existing code.

The only behavioral change is that in getFormat(), the True branch of
if not fmt_class:
will be taken less often because get_device_format_class returns
DeviceFormat instead of None with an argument of None (assuming
DeviceFormat can be found).

This means that
if not fmt_class:
will evaluate to True only when a match can not be found, presumably
because its class could not be read properly.

Of course, if it's DeviceFormat that is not found, falling back to
DeviceFormat makes no sense, but things are pretty much over by then,
anyway.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/formats/__init__.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
index 0f6a8b1..9b9a729 100644
--- a/blivet/formats/__init__.py
+++ b/blivet/formats/__init__.py
@@ -505,4 +505,6 @@ class DeviceFormat(ObjectID):
         data.fstype = self.type
         data.mountpoint = self.ksMountpoint
 
+register_device_format(DeviceFormat)
+
 collect_device_format_classes()
-- 
1.9.3



More information about the anaconda-patches mailing list