split deploy to into two stages

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-16 13:24:40 +02:00
parent 7c56630924
commit b2546fb236

View file

@ -555,10 +555,8 @@ class Cdist:
self.transfer_file(local_remote_code, remote_remote_code)
self.run_or_fail([remote_remote_code], remote=True)
def deploy_to(self):
"""Mimic the old deploy to: Deploy to one host"""
log.info("Deploying to " + self.target_host)
time_start = datetime.datetime.now()
def stage_prepare(self):
"""Do everything for a deploy, minus the actual code stage"""
self.init_deploy()
self.run_global_explores()
self.run_initial_manifest()
@ -580,14 +578,24 @@ class Cdist:
self.objects_prepared.append(cdist_object)
objects = self.list_objects()
def stage_run(self):
"""The final (and real) step of deployment"""
log.debug("Actual run objects")
# Now do the final steps over the existing objects
for cdist_object in objects:
for cdist_object in self.list_objects():
log.debug("Run object: %s", cdist_object)
self.object_run(cdist_object, mode="gencode")
self.object_run(cdist_object, mode="code")
def deploy_to(self):
"""Mimic the old deploy to: Deploy to one host"""
log.info("Deploying to " + self.target_host)
time_start = datetime.datetime.now()
self.stage_prepare()
self.stage_run()
time_end = datetime.datetime.now()
duration = time_end - time_start
log.info("Finished run of %s in %s seconds",