re-add object_prepare, use new run() method

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-05-15 10:08:23 +02:00
parent ead8f7ff76
commit 51c8687455
2 changed files with 9 additions and 2 deletions

View File

@ -129,6 +129,13 @@ class ConfigInstall(object):
raise cdist.Error("The requirements of the following objects could not be resolved: %s" % raise cdist.Error("The requirements of the following objects could not be resolved: %s" %
("; ".join(info_string))) ("; ".join(info_string)))
def object_prepare(self, cdist_object):
"""Prepare object: Run type explorer + manifest"""
self.log.info("Running manifest and explorers for " + cdist_object.name)
self.explorer.run_type_explorers(cdist_object)
self.manifest.run_type_manifest(cdist_object)
cdist_object.state = core.CdistObject.STATE_PREPARED
def object_run(self, cdist_object, dry_run=False): def object_run(self, cdist_object, dry_run=False):
"""Run gencode and code for an object""" """Run gencode and code for an object"""
self.log.debug("Trying to run object " + cdist_object.name) self.log.debug("Trying to run object " + cdist_object.name)

View File

@ -160,7 +160,7 @@ def configinstall(args, mode):
(time_end - time_start)) (time_end - time_start))
if len(failed_hosts) > 0: if len(failed_hosts) > 0:
raise cdist.Error("Failed to deploy to the following hosts: " + raise cdist.Error("Failed to configure the following hosts: " +
" ".join(failed_hosts)) " ".join(failed_hosts))
def configinstall_onehost(host, args, mode, parallel): def configinstall_onehost(host, args, mode, parallel):
@ -179,7 +179,7 @@ def configinstall_onehost(host, args, mode, parallel):
debug=args.debug) debug=args.debug)
c = mode(context) c = mode(context)
c.deploy_and_cleanup() c.run()
context.cleanup() context.cleanup()
except cdist.Error as e: except cdist.Error as e: