def set_machine(self, machine): self.check_target_set() self.machine.set_machine(machine) logdir = path(self.defenv.get('installer', 'base_log_directory')) if not logdir.isdir(): logdir.mkdir() logfile = logdir / 'paella-install-%s.log' % machine os.environ['PAELLA_MACHINE'] = machine disklogpath = path(self.defenv.get('installer', 'disk_log_directory')) self.disklogpath = disklogpath / ('disklog-%s' % machine) if not self.disklogpath.isdir(): self.disklogpath.makedirs() self.set_logfile(logfile) self.log.info('machine set to %s' % machine) # we need to set machine_data before setting the profile # so that the machine_data is passed to the profile and trait installers self.machine_data = self.machine.get_machine_data() profile = self.machine.get_profile() self.set_profile(profile) self.curenv = CurrentEnvironment(self.conn, machine) self.helper = MachineInstallerHelper(self) self.helper.curenv = self.curenv
def set_machine(self, machine): self.machine.set_machine(machine) # this needs to be a configuration option # in the default environment logdir = path('/paellalog') if not logdir.isdir(): logdir.mkdir() logfile = logdir / 'paella-install-%s.log' % machine os.environ['PAELLA_MACHINE'] = machine self.disklogpath = logdir / ('disklog-%s' % machine) if not self.disklogpath.isdir(): self.disklogpath.mkdir() self.set_logfile(logfile) self.log.info('machine set to %s' % machine) # we need to set mtypedata before setting the profile # so that the mtypedata is passed to the profile and trait installers self.mtypedata = self.machine.mtype.get_machine_type_data() profile = self.machine.current.profile self.set_profile(profile) self.curenv = CurrentEnvironment(self.conn, machine) self.helper = MachineInstallerHelper(self) self.helper.curenv = self.curenv