From: David Lehman <dlehman(a)redhat.com>
---
blivet/populator/helpers/formatpopulator.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/blivet/populator/helpers/formatpopulator.py
b/blivet/populator/helpers/formatpopulator.py
index b65a37f..014d6a5 100644
--- a/blivet/populator/helpers/formatpopulator.py
+++ b/blivet/populator/helpers/formatpopulator.py
@@ -78,14 +78,19 @@ def _get_kwargs(self):
"exists": True}
return kwargs
- def run(self):
- """ Create a format instance and associate it with the device
instance. """
- kwargs = self._get_kwargs()
+ @property
+ def type_spec(self):
if self._type_specifier is not None:
type_spec = self._type_specifier
else:
- type_spec = udev.device_get_format(self.data)
+ type_spec = udev.device_get_format(self.data) or None
+
+ return type_spec
+ def run(self):
+ """ Create a format instance and associate it with the device
instance. """
+ kwargs = self._get_kwargs()
+ type_spec = self.type_spec
try:
log.info("type detected on '%s' is '%s'",
self.device.name, type_spec)
self.device.format = formats.get_format(type_spec, **kwargs)
--
To view this commit on github, visit
https://github.com/rhinstaller/blivet/commit/e3e82244a494772bef61b0e6ce06...