From 08975c4d2f2f78fa13fc0ed1fa07c96d557670da Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 7 Oct 2011 09:47:29 +0200 Subject: [PATCH] path -> config_install Signed-off-by: Nico Schottelius --- lib/cdist/config_install.py | 36 ++++++++++++++++++++++++++++++++++++ lib/cdist/path.py | 35 ----------------------------------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/lib/cdist/config_install.py b/lib/cdist/config_install.py index 2071a0e9..9e2b5edc 100644 --- a/lib/cdist/config_install.py +++ b/lib/cdist/config_install.py @@ -278,3 +278,39 @@ class ConfigInstall: self.run_type_manifest(cdist_object) cdist_object.prepared = True new_objects_created = True + + # FIXME Move into configinstall + def transfer_object_parameter(self, cdist_object): + """Transfer the object parameter to the remote destination""" + # Create base path before using mkdir -p + self.remote_mkdir(self.remote_object_parameter_dir(cdist_object)) + + # Synchronise parameter dir afterwards + self.transfer_dir(self.object_parameter_dir(cdist_object), + self.remote_object_parameter_dir(cdist_object)) + + # FIXME Move into configinstall + def transfer_global_explorers(self): + """Transfer the global explorers""" + self.remote_mkdir(REMOTE_GLOBAL_EXPLORER_DIR) + self.transfer_dir(self.global_explorer_dir, REMOTE_GLOBAL_EXPLORER_DIR) + + # FIXME Move into configinstall + def transfer_type_explorers(self, type): + """Transfer explorers of a type, but only once""" + if type.transferred_explorers: + log.debug("Skipping retransfer for explorers of %s", type) + return + else: + # Do not retransfer + type.transferred_explorers = True + + # FIXME: Can be explorer_path or explorer_dir, I don't care. + src = type.explorer_path() + dst = type.remote_explorer_path() + + # Transfer if there is at least one explorer + if len(type.explorers) > 0: + # Ensure that the path exists + self.remote_mkdir(dst) + self.transfer_dir(src, dst) diff --git a/lib/cdist/path.py b/lib/cdist/path.py index 2f6670e8..2dc06ceb 100644 --- a/lib/cdist/path.py +++ b/lib/cdist/path.py @@ -113,38 +113,3 @@ class Path: def remove_remote_dir(self, destination): cdist.exec.run_or_fail(["rm", "-rf", destination], remote_prefix=True) - # FIXME Move into configinstall - def transfer_object_parameter(self, cdist_object): - """Transfer the object parameter to the remote destination""" - # Create base path before using mkdir -p - self.remote_mkdir(self.remote_object_parameter_dir(cdist_object)) - - # Synchronise parameter dir afterwards - self.transfer_dir(self.object_parameter_dir(cdist_object), - self.remote_object_parameter_dir(cdist_object)) - - # FIXME Move into configinstall - def transfer_global_explorers(self): - """Transfer the global explorers""" - self.remote_mkdir(REMOTE_GLOBAL_EXPLORER_DIR) - self.transfer_dir(self.global_explorer_dir, REMOTE_GLOBAL_EXPLORER_DIR) - - # FIXME Move into configinstall - def transfer_type_explorers(self, type): - """Transfer explorers of a type, but only once""" - if type.transferred_explorers: - log.debug("Skipping retransfer for explorers of %s", type) - return - else: - # Do not retransfer - type.transferred_explorers = True - - # FIXME: Can be explorer_path or explorer_dir, I don't care. - src = type.explorer_path() - dst = type.remote_explorer_path() - - # Transfer if there is at least one explorer - if len(type.explorers) > 0: - # Ensure that the path exists - self.remote_mkdir(dst) - self.transfer_dir(src, dst)