From 35a7757e1aa6f1f7d6722a6bd903ce631aefb24a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 6 Oct 2011 20:51:31 +0200 Subject: [PATCH] rewrite path to include calls to non-existent methods in type (fix needed, sar :-) Signed-off-by: Nico Schottelius --- lib/cdist/path.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/cdist/path.py b/lib/cdist/path.py index d82ae974..deeb6b0d 100644 --- a/lib/cdist/path.py +++ b/lib/cdist/path.py @@ -255,19 +255,25 @@ class Path: # Stays here - FIXME: adjust to type code, loop over types! def transfer_type_explorers(self, type): """Transfer explorers of a type, but only once""" - if type in self.type_explorers_transferred: + if type.transferred: log.debug("Skipping retransfer for explorers of %s", type) return else: # Do not retransfer - self.type_explorers_transferred[type] = 1 + type.transferred = True - src = self.type_dir(type, "explorer") - remote_base = os.path.join(REMOTE_TYPE_DIR, type) - dst = self.remote_type_explorer_dir(type) + # FIXME: need to get explorer path from type! + src = type.explorer_path() + dst = type.remote_explorer_path() + # FIXME: where to construct remote path? here? + # remote_base = os.path.join(REMOTE_TYPE_DIR, type.name) + # dst = self.remote_type_explorer_dir(type) # Only continue, if there is at least the directory - if os.path.isdir(src): + #if os.path.isdir(src): + + # Transfer if there is at least one explorer + if len(type.explorers) > 0: # Ensure that the path exists - self.remote_mkdir(remote_base) + self.remote_mkdir(dst) self.transfer_dir(src, dst)