Example #1
0
 def setUp(self):
     self.orig_environ = os.environ
     os.environ = os.environ.copy()
     self.temp_dir = self.mkdtemp()
     self.target_host = 'localhost'
     out_path = self.temp_dir
     self.local = local.Local(self.target_host, local_base_path, out_path)
     self.local.create_directories()
     self.local.link_emulator(cdist.test.cdist_exec_path)
     self.manifest = manifest.Manifest(self.target_host, self.local)
     self.log = logging.getLogger(self.target_host)
Example #2
0
    def setUp(self):
        # logging.root.setLevel(logging.TRACE)
        save_output_streams = False
        self.temp_dir = self.mkdtemp()

        self.local_dir = os.path.join(self.temp_dir, "local")
        self.hostdir = cdist.str_hash(self.target_host[0])
        self.host_base_path = os.path.join(self.local_dir, self.hostdir)
        os.makedirs(self.host_base_path)
        self.local = local.Local(target_host=self.target_host,
                                 target_host_tags=None,
                                 base_root_path=self.host_base_path,
                                 host_dir_name=self.hostdir,
                                 exec_path=cdist.test.cdist_exec_path,
                                 add_conf_dirs=[conf_dir],
                                 save_output_streams=save_output_streams)
        self.local.create_files_dirs()

        self.remote_dir = self.mkdtemp()
        remote_exec = self.remote_exec
        remote_copy = self.remote_copy
        self.remote = remote.Remote(
            target_host=self.target_host,
            remote_exec=remote_exec,
            remote_copy=remote_copy,
            base_path=self.remote_dir,
            stdout_base_path=self.local.stdout_base_path,
            stderr_base_path=self.local.stderr_base_path,
            save_output_streams=save_output_streams)
        self.remote.create_files_dirs()

        self.code = code.Code(self.target_host, self.local, self.remote)

        self.manifest = manifest.Manifest(self.target_host, self.local)

        self.cdist_type = core.CdistType(self.local.type_path,
                                         '__write_to_stdout_and_stderr')
        self.cdist_object = core.CdistObject(self.cdist_type,
                                             self.local.object_path,
                                             self.local.object_marker_name, '')
        self.cdist_object.create()
        self.output_dirs = {
            'object': {
                'stdout': os.path.join(self.cdist_object.absolute_path,
                                       'stdout'),
                'stderr': os.path.join(self.cdist_object.absolute_path,
                                       'stderr'),
            },
            'init': {
                'stdout': os.path.join(self.local.base_path, 'stdout'),
                'stderr': os.path.join(self.local.base_path, 'stderr'),
            },
        }
Example #3
0
    def setUp(self):
        self.orig_environ = os.environ
        os.environ = os.environ.copy()
        self.temp_dir = self.mkdtemp()

        out_path = self.temp_dir
        self.local = local.Local(target_host=self.target_host,
                                 base_path=out_path,
                                 exec_path=cdist.test.cdist_exec_path,
                                 add_conf_dirs=[conf_dir])
        self.local.create_files_dirs()

        self.manifest = manifest.Manifest(self.target_host, self.local)
        self.log = logging.getLogger(self.target_host)
Example #4
0
    def setUp(self):
        self.orig_environ = os.environ
        os.environ = os.environ.copy()
        self.temp_dir = self.mkdtemp()

        out_path = self.temp_dir
        hostdir = cdist.str_hash(self.target_host[0])
        base_root_path = os.path.join(out_path, hostdir)
        self.local = local.Local(target_host=self.target_host,
                                 target_host_tags=self.target_host_tags,
                                 base_root_path=base_root_path,
                                 host_dir_name=hostdir,
                                 exec_path=cdist.test.cdist_exec_path,
                                 add_conf_dirs=[conf_dir])
        self.local.create_files_dirs()

        self.manifest = manifest.Manifest(self.target_host, self.local)
        self.log = logging.getLogger(self.target_host[0])