Example #1
0
    def __init__(self, parent):
        BaseInstaller.__init__(self, parent.conn)
        self._parent = parent
        self.target = parent.target
        # we need this paelladir attribute for now
        # but may replace/redo this later
        self.paelladir = self.target / 'root/paella'
        self.profile = None
        self.suite = None
        self.profiletrait = ProfileTrait(self.conn)
        self._profile = Profile(self.conn)
        if False:
            # setup logfile
            if hasattr(parent, 'log'):
                self.log = parent.log
                self.log.info('profile installer initialized')
            else:
                raise RuntimeError, 'No logfile for parent defined'
        if hasattr(parent, 'mainlog'):
            self.mainlog = parent.mainlog
            name = self.__class__.__name__
            self.mainlog.add_logger(name)
            self.log = self.mainlog.loggers[name]

        # make empty data dicts
        self.machine_data = {}
        self.familydata = {}
        self.profiledata = {}
Example #2
0
 def __init__(self, parent):
     BaseInstaller.__init__(self, parent.conn)
     self._parent = parent
     self.target = parent.target
     # we need this paelladir attribute for now
     # but may replace/redo this later
     self.paelladir = self.target / 'root/paella'
     self.profile = None
     self.suite = None
     self.profiletrait = ProfileTrait(self.conn)
     self._profile = Profile(self.conn)
     if False:
         # setup logfile
         if hasattr(parent, 'log'):
             self.log = parent.log
             self.log.info('profile installer initialized')
         else:
             raise RuntimeError, 'No logfile for parent defined'
     if hasattr(parent, 'mainlog'):
         self.mainlog = parent.mainlog
         name = self.__class__.__name__
         self.mainlog.add_logger(name)
         self.log = self.mainlog.loggers[name]
         
     # make empty data dicts
     self.mtypedata = {}
     self.familydata = {}
     self.profiledata = {}
Example #3
0
    def __init__(self, conn):
        BaseInstaller.__init__(self, conn)
        self._bootstrapped = False
        self._install_finished = False

        self._processes = [
            'ready_target', 'bootstrap', 'mount_target_proc',
            'mount_target_sys', 'make_device_entries', 'mount_target_devpts',
            'apt_sources_installer', 'ready_base_for_install', 'pre_install',
            'install', 'post_install', 'apt_sources_final',
            'umount_target_sys', 'umount_target_proc'
        ]
        # pre_install is unmapped
        # post_install is unmapped
        self._process_map = dict(
            ready_target=self.create_target_directory,
            bootstrap=self.bootstrap_target,
            mount_target_proc=self.mount_target_proc,
            mount_target_sys=self.mount_target_sys,
            make_device_entries=self.make_device_entries,
            mount_target_devpts=self.mount_target_devpts,
            apt_sources_installer=self.apt_sources_installer,
            ready_base_for_install=self.ready_base_for_install,
            install=self.install,
            apt_sources_final=self.apt_sources_final,
            umount_target_sys=self.umount_target_sys,
            umount_target_proc=self.umount_target_proc)
        # this is only used in the machine installer
        self.mtypedata = {}
Example #4
0
 def run_all_processes(self):
     traits = self.make_traitlist()
     self.setup_initial_paellainfo_files(traits)
     self.setup_initial_paellainfo_env(traits)
     self.processed = []
     self.current_index = 0
     BaseInstaller.run_all_processes(self)
     self.log.info('all traits processed for profile %s' % self.profile)
     self.log.info('------------------------------------')
Example #5
0
 def run_all_processes(self):
     traits = self.make_traitlist()
     self.setup_initial_paellainfo_files(traits)
     self.setup_initial_paellainfo_env(traits)
     self.processed = []
     self.current_index = 0
     BaseInstaller.run_all_processes(self)
     self.log.info('all traits processed for profile %s' % self.profile)
     self.log.info('------------------------------------')
Example #6
0
    def __init__(self, parent):
        BaseInstaller.__init__(self, parent.conn)
        self.target = parent.target
        self.suite = parent.suite
        if False:
            # setup logfile
            if hasattr(parent, 'log'):
                self.log = parent.log
                self.log.info('trait installer initialized')
            else:
                raise RuntimeError, 'No logfile for parent defined'

        if hasattr(parent, 'mainlog'):
            self.mainlog = parent.mainlog
            name = self.__class__.__name__
            self.mainlog.add_logger(name)
            self.log = self.mainlog.loggers[name]
        # setup process list
        self._processes = DEFAULT_PROCESSES
        if self.defenv.has_option('installer', 'trait_processes'):
            self._processes = self.defenv.get_list('trait_processes',
                                                   'installer')

        # setup process map
        # pre and post here are not the same as in the BaseProcessor
        # For example, if a script exists for for pre, it works like this:
        #   self.pre_process()
        #   self.run_process_script(pre)
        #   self.post_process()
        # pre, chroot, config, and post are not mapped
        # as they are scripts only
        self._process_map = dict(
            preseed=self.run_process_preseed,
            remove=self.run_process_remove,
            install=self.run_process_install,
            templates=self.run_process_templates,
            reconfig=self.run_process_reconfig,
        )

        # init helper to do the work
        self.helper = TraitInstallerHelper(self.conn, self.suite, self.target)
        # pass the log object to the helper
        self.helper.log = self.log
        # this is really ugly, but works for now
        for attr in ['familydata', 'profiledata', 'machine_data']:
            setattr(self, attr, getattr(parent, attr))
            setattr(self.helper, attr, getattr(self, attr))
Example #7
0
    def __init__(self, parent):
        BaseInstaller.__init__(self, parent.conn)
        self.target = parent.target
        self.suite = parent.suite
        if False:
            # setup logfile
            if hasattr(parent, 'log'):
                self.log = parent.log
                self.log.info('trait installer initialized')
            else:
                raise RuntimeError , 'No logfile for parent defined'
            
        if hasattr(parent, 'mainlog'):
            self.mainlog = parent.mainlog
            name = self.__class__.__name__
            self.mainlog.add_logger(name)
            self.log = self.mainlog.loggers[name]
        # setup process list
        self._processes = DEFAULT_PROCESSES
        if self.defenv.has_option('installer', 'trait_processes'):
            self._processes = self.defenv.get_list('trait_processes', 'installer')
            
        # setup process map
        # pre and post here are not the same as in the BaseProcessor
        # For example, if a script exists for for pre, it works like this:
        #   self.pre_process()
        #   self.run_process_script(pre)
        #   self.post_process()
        # pre, chroot, config, and post are not mapped
        # as they are scripts only
        self._process_map = dict(preseed=self.run_process_preseed,
                                 remove=self.run_process_remove,
                                 install=self.run_process_install,
                                 templates=self.run_process_templates,
                                 reconfig=self.run_process_reconfig,
                                 )

        # init helper to do the work
        self.helper = TraitInstallerHelper(self.conn, self.suite, self.target)
        # pass the log object to the helper
        self.helper.log = self.log
        # this is really ugly, but works for now
        for attr in ['familydata', 'profiledata', 'machine_data']:
            setattr(self, attr, getattr(parent, attr))
            setattr(self.helper, attr, getattr(self, attr))
Example #8
0
    def __init__(self, parent):
        BaseInstaller.__init__(self, parent.conn)
        self.target = parent.target
        self.suite = parent.suite
        if hasattr(parent, "mainlog"):
            self.mainlog = parent.mainlog
            name = self.__class__.__name__
            self.mainlog.add_logger(name)
            self.log = self.mainlog.loggers[name]
        # setup process list
        self._processes = DEFAULT_PROCESSES
        if self.defenv.has_option("installer", "trait_processes"):
            self._processes = self.defenv.get_list("trait_processes", "installer")
            # if the trait_processes option is empty,
            # revert back to the default processes
            if not self._processes:
                self._processes = DEFAULT_PROCESSES
        # setup process map
        # pre and post here are not the same as in the BaseProcessor
        # For example, if a script exists for for pre, it works like this:
        #   self.pre_process()
        #   self.run_process_script(pre)
        #   self.post_process()
        # pre, chroot, config, and post are not mapped
        # as they are scripts only
        self._process_map = dict(
            preseed=self.run_process_preseed,
            remove=self.run_process_remove,
            install=self.run_process_install,
            templates=self.run_process_templates,
            reconfig=self.run_process_reconfig,
        )

        # init helper to do the work
        self.helper = TraitInstallerHelper(self.conn, self.suite, self.target)
        # pass the log object to the helper
        self.helper.log = self.log
        # also pass default environment to the helper
        self.helper.defenv = self.defenv
        # this is really ugly, but works for now
        for attr in ["familydata", "profiledata", "machine_data"]:
            setattr(self, attr, getattr(parent, attr))
            setattr(self.helper, attr, getattr(self, attr))
Example #9
0
    def __init__(self, parent):
        BaseInstaller.__init__(self, parent.conn)
        self._parent = parent
        self.target = parent.target
        # we need this paelladir attribute for now
        # but may replace/redo this later
        self.paelladir = self.target / 'root/paella'
        self.profile = None
        self.suite = None
        self.profiletrait = ProfileTrait(self.conn)
        self._profile = Profile(self.conn)
        if hasattr(parent, 'mainlog'):
            self.mainlog = parent.mainlog
            name = self.__class__.__name__
            self.mainlog.add_logger(name)
            self.log = self.mainlog.loggers[name]

        # make empty data dicts
        self.machine_data = {}
        self.familydata = {}
        self.profiledata = {}
Example #10
0
 def __init__(self, parent):
     BaseInstaller.__init__(self, parent.conn)
     self._parent = parent
     self.target = parent.target
     # we need this paelladir attribute for now
     # but may replace/redo this later
     self.paelladir = self.target / 'root/paella'
     self.profile = None
     self.suite = None
     self.profiletrait = ProfileTrait(self.conn)
     self._profile = Profile(self.conn)
     if hasattr(parent, 'mainlog'):
         self.mainlog = parent.mainlog
         name = self.__class__.__name__
         self.mainlog.add_logger(name)
         self.log = self.mainlog.loggers[name]
         
     # make empty data dicts
     self.machine_data = {}
     self.familydata = {}
     self.profiledata = {}
Example #11
0
 def __init__(self, conn):
     BaseInstaller.__init__(self, conn)
     self._bootstrapped = False
     self._install_finished = False
     
     self._processes = [
         'ready_target',
         'bootstrap',
         'mount_target_proc',
         'mount_target_sys',
         'make_device_entries',
         'mount_target_devpts',
         'apt_sources_installer',
         'ready_base_for_install',
         'pre_install',
         'install',
         'post_install',
         'apt_sources_final',
         'umount_target_sys',
         'umount_target_proc'
         ]
     # pre_install is unmapped
     # post_install is unmapped
     self._process_map = dict(ready_target=self.create_target_directory,
                              bootstrap=self.bootstrap_target,
                              mount_target_proc=self.mount_target_proc,
                              mount_target_sys=self.mount_target_sys,
                              make_device_entries=self.make_device_entries,
                              mount_target_devpts=self.mount_target_devpts,
                              apt_sources_installer=self.apt_sources_installer,
                              ready_base_for_install=self.ready_base_for_install,
                              install=self.install,
                              apt_sources_final=self.apt_sources_final,
                              umount_target_sys=self.umount_target_sys,
                              umount_target_proc=self.umount_target_proc
                              )
     # this is only used in the machine installer
     self.mtypedata = {}
Example #12
0
 def set_logfile(self, logfile):
     BaseInstaller.set_logger(self, filename=logfile)
     self.log.info('-'*30)
     msg = '%s initialized' % self.__class__.__name__
     self.log.info(msg)
     self.log.info('-'*30)
Example #13
0
 def __init__(self, conn):
     BaseInstaller.__init__(self, conn)
Example #14
0
 def __init__(self, conn, logfile=None):
     BaseInstaller.__init__(self)
Example #15
0
 def __init__(self, conn, logfile=None):
     BaseInstaller.__init__(self)