split deploy to into two stages
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
7c56630924
commit
b2546fb236
1 changed files with 14 additions and 6 deletions
20
bin/cdist
20
bin/cdist
|
@ -555,10 +555,8 @@ class Cdist:
|
||||||
self.transfer_file(local_remote_code, remote_remote_code)
|
self.transfer_file(local_remote_code, remote_remote_code)
|
||||||
self.run_or_fail([remote_remote_code], remote=True)
|
self.run_or_fail([remote_remote_code], remote=True)
|
||||||
|
|
||||||
def deploy_to(self):
|
def stage_prepare(self):
|
||||||
"""Mimic the old deploy to: Deploy to one host"""
|
"""Do everything for a deploy, minus the actual code stage"""
|
||||||
log.info("Deploying to " + self.target_host)
|
|
||||||
time_start = datetime.datetime.now()
|
|
||||||
self.init_deploy()
|
self.init_deploy()
|
||||||
self.run_global_explores()
|
self.run_global_explores()
|
||||||
self.run_initial_manifest()
|
self.run_initial_manifest()
|
||||||
|
@ -580,14 +578,24 @@ class Cdist:
|
||||||
self.objects_prepared.append(cdist_object)
|
self.objects_prepared.append(cdist_object)
|
||||||
|
|
||||||
objects = self.list_objects()
|
objects = self.list_objects()
|
||||||
|
|
||||||
|
def stage_run(self):
|
||||||
|
"""The final (and real) step of deployment"""
|
||||||
log.debug("Actual run objects")
|
log.debug("Actual run objects")
|
||||||
# Now do the final steps over the existing 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)
|
log.debug("Run object: %s", cdist_object)
|
||||||
self.object_run(cdist_object, mode="gencode")
|
self.object_run(cdist_object, mode="gencode")
|
||||||
self.object_run(cdist_object, mode="code")
|
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()
|
time_end = datetime.datetime.now()
|
||||||
duration = time_end - time_start
|
duration = time_end - time_start
|
||||||
log.info("Finished run of %s in %s seconds",
|
log.info("Finished run of %s in %s seconds",
|
||||||
|
|
Loading…
Reference in a new issue