forked from ungleich-public/cdist
Improve unfinished object requirements bool check
When we need only boolean value for unfinished object requirements then we don't need to determine the whole list of unfinished objects.
This commit is contained in:
parent
ab811ad282
commit
199effb7ef
2 changed files with 19 additions and 6 deletions
|
|
@ -280,7 +280,7 @@ class CdistObject:
|
|||
'{}: {}').format(self, error))
|
||||
|
||||
def requirements_unfinished(self, requirements):
|
||||
"""Return state whether requirements are satisfied"""
|
||||
"""Return unsatisfied requirements"""
|
||||
|
||||
object_list = []
|
||||
|
||||
|
|
@ -291,3 +291,14 @@ class CdistObject:
|
|||
object_list.append(cdist_object)
|
||||
|
||||
return object_list
|
||||
|
||||
def has_requirements_unfinished(self, requirements):
|
||||
"""Return whether requirements are satisfied"""
|
||||
|
||||
for requirement in requirements:
|
||||
cdist_object = self.object_from_name(requirement)
|
||||
|
||||
if cdist_object.state != self.STATE_DONE:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue