prettier print when requirements are broken

Signed-off-by: Nico Schottelius <nico@freiheit.schottelius.org>
This commit is contained in:
Nico Schottelius 2015-02-10 21:59:39 +01:00
parent e98ff2879a
commit 0cf170b18e

View file

@ -229,12 +229,12 @@ class Config(object):
for requirement in cdist_object.requirements_unfinished(cdist_object.autorequire):
autorequire_names.append(requirement.name)
requirements = ", ".join(requirement_names)
autorequire = ", ".join(autorequire_names)
info_string.append("%s requires: %s autorequires: %s" % (cdist_object.name, requirements, autorequire))
requirements = "\n ".join(requirement_names)
autorequire = "\n ".join(autorequire_names)
info_string.append("%s requires:\n %s\n%s autorequires:\n %s" % (cdist_object.name, requirements, cdist_object.name, autorequire))
raise cdist.UnresolvableRequirementsError("The requirements of the following objects could not be resolved: %s" %
("; ".join(info_string)))
raise cdist.UnresolvableRequirementsError("The requirements of the following objects could not be resolved:\n%s" %
("\n".join(info_string)))
def object_prepare(self, cdist_object):
"""Prepare object: Run type explorer + manifest"""