From 3fcbabc5e8db1f41baf6b706baf1826edd9180a8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 7 Oct 2011 16:04:37 +0200 Subject: [PATCH] ++fixes Signed-off-by: Nico Schottelius --- lib/cdist/config_install.py | 8 ++++---- lib/cdist/context.py | 5 +++++ lib/cdist/copy.py | 13 ------------- 3 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 lib/cdist/copy.py diff --git a/lib/cdist/config_install.py b/lib/cdist/config_install.py index c1cdf328..78630f25 100644 --- a/lib/cdist/config_install.py +++ b/lib/cdist/config_install.py @@ -202,7 +202,7 @@ class ConfigInstall: def link_emulator(self): """Link emulator to types""" src = os.path.abspath(self.exec_path) - for type in cdist.core.Type.list_types(): + for type in cdist.core.Type.list_types(self.context.type_base_path): dst = os.path.join(self.context.bin_path, type.name) log.debug("Linking emulator: %s to %s", src, dst) @@ -213,9 +213,9 @@ class ConfigInstall: """Run global explorers""" log.info("Running global explorers") - src_path = cdist.context.global_explorer_path - dst_path = cdist.context.global_explorer_out_path - remote_dst_path = cdist.context.remote_global_explorer_path + src_path = self.context.global_explorer_path + dst_path = self.context.global_explorer_out_path + remote_dst_path = self.context.remote_global_explorer_path self.context.transfer_path(src_path, remote_dst_path) diff --git a/lib/cdist/context.py b/lib/cdist/context.py index f1f031a8..b39e603e 100644 --- a/lib/cdist/context.py +++ b/lib/cdist/context.py @@ -128,3 +128,8 @@ class Context: def remove_remote_path(self, destination): cdist.exec.run_or_fail(["rm", "-rf", destination], remote_prefix=True) + def transfer_path(self, source, destination): + """Transfer directory and previously delete the remote destination""" + self.remove_remote_path(destination) + cdist.exec.run_or_fail(os.environ['__remote_copy'].split() + + ["-r", source, self.target_host + ":" + destination]) diff --git a/lib/cdist/copy.py b/lib/cdist/copy.py deleted file mode 100644 index b0eae54e..00000000 --- a/lib/cdist/copy.py +++ /dev/null @@ -1,13 +0,0 @@ - # FIXME: To Copy - def transfer_dir(self, source, destination): - """Transfer directory and previously delete the remote destination""" - self.remove_remote_dir(destination) - cdist.exec.run_or_fail(os.environ['__remote_copy'].split() + - ["-r", source, self.target_host + ":" + destination]) - - # FIXME: To Copy - def transfer_file(self, source, destination): - """Transfer file""" - cdist.exec.run_or_fail(os.environ['__remote_copy'].split() + - [source, self.target_host + ":" + destination]) -