try new object orientated (hrrr) code instead of stage based
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
parent
d8630dc6d4
commit
a064cc19b3
3 changed files with 122 additions and 3 deletions
|
|
@ -61,6 +61,7 @@ class CdistObject(object):
|
|||
"""
|
||||
|
||||
# Constants for use with Object.state
|
||||
STATE_UNDEF = ""
|
||||
STATE_PREPARED = "prepared"
|
||||
STATE_RUNNING = "running"
|
||||
STATE_DONE = "done"
|
||||
|
|
@ -223,6 +224,23 @@ class CdistObject(object):
|
|||
except EnvironmentError as error:
|
||||
raise cdist.Error('Error creating directories for cdist object: %s: %s' % (self, error))
|
||||
|
||||
@property
|
||||
def requirements_satisfied(self):
|
||||
"""Return state whether normal depedencies are satisfied"""
|
||||
|
||||
satisfied = True
|
||||
|
||||
for requirement in self.requirements:
|
||||
cdist_object = self.object_from_name(requirement)
|
||||
|
||||
if not cdist_object.state == self.STATE_DONE:
|
||||
satisfied = False
|
||||
break
|
||||
|
||||
log.debug("%s is satisfied: %s" % (self.name, satisfied))
|
||||
|
||||
return satisfied
|
||||
|
||||
@property
|
||||
def satisfied_requirements(self):
|
||||
"""Return state whether all of our dependencies have been resolved already"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue