split directory creating code off of init

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-06-21 16:35:19 +02:00
parent b1d661f4c0
commit 347ff8900e

View file

@ -37,11 +37,6 @@ class ConfigInstall(object):
self.context = context
self.log = logging.getLogger(self.context.target_host)
# Initialise local directory structure
self.context.local.create_files_dirs()
# Initialise remote directory structure
self.context.remote.create_files_dirs()
self.explorer = core.Explorer(self.context.target_host, self.context.local, self.context.remote)
self.manifest = core.Manifest(self.context.target_host, self.context.local)
self.code = core.Code(self.context.target_host, self.context.local, self.context.remote)
@ -57,10 +52,17 @@ class ConfigInstall(object):
shutil.rmtree(destination)
shutil.move(self.context.local.out_path, destination)
def _init_files_dirs(self):
"""Prepare files and directories for the run"""
self.context.local.create_files_dirs()
self.context.remote.create_files_dirs()
def run(self):
"""Do what is most often done: deploy & cleanup"""
start_time = time.time()
self._init_files_dirs()
self.explorer.run_global_explorers(self.context.local.global_explorer_out_path)
self.manifest.run_initial_manifest(self.context.initial_manifest)
self.iterate_until_finished()