fix autorequire dependency handling
- inherit explicit requirements that the user defined himself - but _not_ implicit requirements that cdist added for autorequire Changes: - added new .autorequire property to CdistObject to keep track of implicit autorequire dependencies - Emulator appends implicit requirements to this .autorequire property - DependencyResolver preprocess these .autorequire properties before resolving normal dependencies - refactored and documented DependencyResolver so it's clearer what happens and easier to use from tests - update test cases to match new DependencyResolver behaviour Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
3d0493bb65
commit
7d61b77708
18 changed files with 156 additions and 37 deletions
|
|
@ -167,12 +167,8 @@ class Emulator(object):
|
|||
parent = self.cdist_object.object_from_name(__object_name)
|
||||
# The object currently being defined
|
||||
current_object = self.cdist_object
|
||||
# current_object shall have all dependencies that it's parent has
|
||||
for req in parent.requirements:
|
||||
if req not in current_object.requirements:
|
||||
current_object.requirements.append(req)
|
||||
# As parent defined current_object it shall automatically depend on it.
|
||||
# But only if the user hasn't said otherwise.
|
||||
# Must prevent circular dependencies.
|
||||
if not parent.name in current_object.requirements:
|
||||
parent.requirements.append(current_object.name)
|
||||
parent.autorequire.append(current_object.name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue