def setUp(self): self.temp_dir = self.mkdtemp() handle, self.script = self.mkstemp(dir=self.temp_dir) os.close(handle) out_path = self.temp_dir self.local = local.Local(target_host=self.target_host, out_path=out_path, exec_path=test.cdist_exec_path, add_conf_dirs=[conf_dir]) self.local.create_files_dirs() self.manifest = core.Manifest(self.target_host, self.local) self.env = self.manifest.env_initial_manifest(self.script)
def __init__(self, local, remote, dry_run=False, jobs=None): self.local = local self.remote = remote self._open_logger() self.dry_run = dry_run self.jobs = jobs self.explorer = core.Explorer(self.local.target_host, self.local, self.remote, jobs=self.jobs) self.manifest = core.Manifest(self.local.target_host, self.local) self.code = core.Code(self.local.target_host, self.local, self.remote)
def setUp(self): self.temp_dir = self.mkdtemp() base_path = os.path.join(self.temp_dir, "out") hostdir = cdist.str_hash(self.target_host[0]) host_base_path = os.path.join(base_path, hostdir) self.local = local.Local(target_host=self.target_host, target_host_tags=self.target_host_tags, base_root_path=host_base_path, host_dir_name=hostdir, exec_path=test.cdist_exec_path, add_conf_dirs=[conf_dir]) self.local.create_files_dirs() self.manifest = core.Manifest(self.target_host, self.local)
def setUp(self): self.temp_dir = self.mkdtemp() handle, self.script = self.mkstemp(dir=self.temp_dir) os.close(handle) base_path = self.temp_dir self.local = local.Local(target_host=self.target_host, base_path=base_path, exec_path=test.cdist_exec_path, add_conf_dirs=[conf_dir]) self.local.create_files_dirs() self.manifest = core.Manifest(self.target_host, self.local) self.env = self.manifest.env_initial_manifest(self.script) self.env['__cdist_object_marker'] = self.local.object_marker_name
def setUp(self): self.orig_environ = os.environ os.environ = os.environ.copy() self.temp_dir = self.mkdtemp() out_path = os.path.join(self.temp_dir, "out") self.local = local.Local(target_host=self.target_host, out_path=out_path, exec_path=test.cdist_exec_path, add_conf_dirs=[conf_dir]) self.local.create_files_dirs() self.manifest = core.Manifest(target_host=self.target_host, local=self.local)
def __init__(self, local, remote, dry_run=False, jobs=None, cleanup_cmds=None, remove_remote_files_dirs=False): self.local = local self.remote = remote self._open_logger() self.dry_run = dry_run self.jobs = jobs if cleanup_cmds: self.cleanup_cmds = cleanup_cmds else: self.cleanup_cmds = [] self.remove_remote_files_dirs = remove_remote_files_dirs self.explorer = core.Explorer(self.local.target_host, self.local, self.remote, jobs=self.jobs) self.manifest = core.Manifest(self.local.target_host, self.local) self.code = core.Code(self.local.target_host, self.local, self.remote)
def setUp(self): self.temp_dir = self.mkdtemp() base_path = self.temp_dir hostdir = cdist.str_hash(self.target_host[0]) host_base_path = os.path.join(base_path, hostdir) handle, self.script = self.mkstemp(dir=self.temp_dir) os.close(handle) self.local = local.Local(target_host=self.target_host, base_root_path=host_base_path, host_dir_name=hostdir, exec_path=test.cdist_exec_path, add_conf_dirs=[conf_dir]) self.local.create_files_dirs() self.manifest = core.Manifest(self.target_host, self.local) self.env = self.manifest.env_initial_manifest(self.script) self.env['__cdist_object_marker'] = self.local.object_marker_name
def __init__(self, context): self.context = context self.log = logging.getLogger(self.context.target_host) # For easy access self.local = context.local self.remote = context.remote # Initialise local directory structure self.local.create_directories() # Initialise remote directory structure self.remote.create_directories() self.explorer = core.Explorer(self.context.target_host, self.local, self.remote) self.manifest = core.Manifest(self.context.target_host, self.local) self.code = core.Code(self.context.target_host, self.local, self.remote)
def __init__(self, context): self.context = context self.log = logging.getLogger(self.context.target_host) # Initialise local directory structure self.context.local.create_files_dirs() # Initialise remote directory structure self.context.remote.create_files_dirs() self.explorer = core.Explorer(self.context.target_host, self.context.local, self.context.remote) self.manifest = core.Manifest(self.context.target_host, self.context.local) self.code = core.Code(self.context.target_host, self.context.local, self.context.remote) # Add switch to disable code execution self.dry_run = False