path -> config_install

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-10-07 09:47:29 +02:00
parent 0b63919cdd
commit 08975c4d2f
2 changed files with 36 additions and 35 deletions

View file

@ -278,3 +278,39 @@ class ConfigInstall:
self.run_type_manifest(cdist_object) self.run_type_manifest(cdist_object)
cdist_object.prepared = True cdist_object.prepared = True
new_objects_created = 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)

View file

@ -113,38 +113,3 @@ class Path:
def remove_remote_dir(self, destination): def remove_remote_dir(self, destination):
cdist.exec.run_or_fail(["rm", "-rf", destination], remote_prefix=True) 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)