Skip to content

Commit

Permalink
Merge pull request #973 from vojtechtrefny/3.4-devel_fix-availability…
Browse files Browse the repository at this point in the history
…-errors-log

Improve error message printed for missing dependecies
  • Loading branch information
vojtechtrefny authored Aug 16, 2021
2 parents f461a3a + 310fe0e commit 620685c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blivet/deviceaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def __init__(self, device):
def _check_device_dependencies(self):
unavailable_dependencies = self.device.unavailable_dependencies
if unavailable_dependencies:
dependencies_str = ", ".join(str(d) for d in unavailable_dependencies)
dependencies_str = ", ".join("%s:\n%s" % (str(d), ", ".join(d.availability_errors)) for d in unavailable_dependencies)
raise DependencyError("device type %s requires unavailable_dependencies: %s" % (self.device.type, dependencies_str))

def apply(self):
Expand Down
4 changes: 2 additions & 2 deletions blivet/tasks/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def _check_technologies(self):
try:
self._tech_info.check_fn(tech, mode)
except GLib.GError as e:
errors.append(str(e))
errors.append("%s: %s" % (tech.value_name, e.message))
return errors

def availability_errors(self, resource):
Expand All @@ -242,7 +242,7 @@ def availability_errors(self, resource):
tech_missing = self._check_technologies()
if tech_missing:
return ["libblockdev plugin %s is loaded but some required "
"technologies are not available:\n%s" % (self._tech_info.plugin_name, tech_missing)]
"technologies are not available (%s)" % (self._tech_info.plugin_name, "; ".join(tech_missing))]
else:
return []

Expand Down

0 comments on commit 620685c

Please sign in to comment.