From 97ac276433bd15722d3ada5891d47d00ddb90856 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 8 Sep 2011 17:52:15 +0200 Subject: [PATCH] implement transfer of type explorers Signed-off-by: Nico Schottelius --- bin/cdist | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/cdist b/bin/cdist index 4e62bd64..56327fb4 100755 --- a/bin/cdist +++ b/bin/cdist @@ -211,15 +211,20 @@ class Cdist: def transfer_type_explorers(self, type): """Transfer explorers of a type, but only once""" - if self.type_explorers_transferred[type] == 1 + if type in self.type_explorers_transferred: return - else - self.type_explorers_transferred[type] = 1 src = os.path.join(TYPE_DIR, type) - dst = os.path.join(REMOTE_TYPE_DIR, type, "explorer") + base = os.path.join(REMOTE_TYPE_DIR, type) + dst = os.path.join(base, "explorer") + + # Ensure the path path exists + self.remote_run_or_fail(["mkdir", "-p", base]) self.transfer_dir(src, dst) + # Do not retransfer + self.type_explorers_transferred[type] = 1 + def link_type_to_emulator(self): """Link type names to cdist-type-emulator""" for type in list_types():