|
|
|
@ -486,7 +486,6 @@ class Config(object): |
|
|
|
|
objects_changed = False |
|
|
|
|
|
|
|
|
|
for cdist_object in self.object_list(): |
|
|
|
|
try: |
|
|
|
|
if cdist_object.requirements_unfinished( |
|
|
|
|
cdist_object.requirements): |
|
|
|
|
"""We cannot do anything for this poor object""" |
|
|
|
@ -508,8 +507,6 @@ class Config(object): |
|
|
|
|
if cdist_object.state == core.CdistObject.STATE_PREPARED: |
|
|
|
|
self.object_run(cdist_object) |
|
|
|
|
objects_changed = True |
|
|
|
|
except cdist.Error as e: |
|
|
|
|
raise cdist.CdistObjectError(cdist_object, e) |
|
|
|
|
|
|
|
|
|
return objects_changed |
|
|
|
|
|
|
|
|
@ -694,16 +691,20 @@ class Config(object): |
|
|
|
|
|
|
|
|
|
def object_prepare(self, cdist_object, transfer_type_explorers=True): |
|
|
|
|
"""Prepare object: Run type explorer + manifest""" |
|
|
|
|
try: |
|
|
|
|
self.log.verbose("Preparing object {}".format(cdist_object.name)) |
|
|
|
|
self.log.verbose( |
|
|
|
|
"Running manifest and explorers for " + cdist_object.name) |
|
|
|
|
self.explorer.run_type_explorers(cdist_object, transfer_type_explorers) |
|
|
|
|
self.explorer.run_type_explorers(cdist_object, |
|
|
|
|
transfer_type_explorers) |
|
|
|
|
self.manifest.run_type_manifest(cdist_object) |
|
|
|
|
cdist_object.state = core.CdistObject.STATE_PREPARED |
|
|
|
|
except cdist.Error as e: |
|
|
|
|
raise cdist.CdistObjectError(cdist_object, e) |
|
|
|
|
|
|
|
|
|
def object_run(self, cdist_object): |
|
|
|
|
"""Run gencode and code for an object""" |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
self.log.verbose("Running object " + cdist_object.name) |
|
|
|
|
if cdist_object.state == core.CdistObject.STATE_DONE: |
|
|
|
|
raise cdist.Error(("Attempting to run an already finished " |
|
|
|
@ -712,7 +713,8 @@ class Config(object): |
|
|
|
|
# Generate |
|
|
|
|
self.log.debug("Generating code for %s" % (cdist_object.name)) |
|
|
|
|
cdist_object.code_local = self.code.run_gencode_local(cdist_object) |
|
|
|
|
cdist_object.code_remote = self.code.run_gencode_remote(cdist_object) |
|
|
|
|
cdist_object.code_remote = self.code.run_gencode_remote( |
|
|
|
|
cdist_object) |
|
|
|
|
if cdist_object.code_local or cdist_object.code_remote: |
|
|
|
|
cdist_object.changed = True |
|
|
|
|
|
|
|
|
@ -733,3 +735,5 @@ class Config(object): |
|
|
|
|
# Mark this object as done |
|
|
|
|
self.log.trace("Finishing run of " + cdist_object.name) |
|
|
|
|
cdist_object.state = core.CdistObject.STATE_DONE |
|
|
|
|
except cdist.Error as e: |
|
|
|
|
raise cdist.CdistObjectError(cdist_object, e) |
|
|
|
|