Example #1
0
    def init(self, core):
        AbstractNuConfComponent.init(self, core)
        self.context = Context.fromComponent(self)
        self.var_dir = self.core.config.get('CORE', 'vardir')
        self.ufwi_conf_var_dir = join(self.var_dir, 'ufwi_conf')
        if self.core.config.getboolean('CORE', 'use_edenwall'):
            warn_dangerous_files(self)
        if not check_and_correct_lo(self):
            self.critical("Networking configuration problem. :-(")

        self.core = core
        self.ethtool = Ethtool('/usr/sbin/ethtool', self)

        if not self.config_loaded:
            self.autoconf()
            self.save_config(
                    CONFIG_AUTOCONFIGURATION,
                    "network : auto configuration",
                    self.context
                    )
        else:
            self.info("not autoconfiguring")

        self.core.notify.connect('ha', 'ImportStart', self.__haImportStart)
        self.core.notify.connect('ha', 'ImportEnd', self.__haImportEnd)
Example #2
0
 def init(self, core):
     AbstractNuConfComponent.init(self, core)
     self.body_template = self.read_body_template()
     for genfile in (
         GENFILE_ALIASES,
         GENFILE_EMAIL_ADDRESSES
         ):
         self.addConfFile(genfile, 'root:root', '0644')
Example #3
0
    def init(self, core):
        AbstractNuConfComponent.init(self, core)
        self.core = core

        # dict: service name => port list
        self.services = None

        # Read streaming port from the config
        port = core.config.getint('CORE', 'streaming_udp_port')
        self.HARDCODED_SERVICES['ufwi_rpcd_access'][1]['port'] = port
Example #4
0
 def init(self, core):
     AbstractNuConfComponent.init(self, core)
     self.core = core
     self.license_dir = DEFAULT_LICENSE_DIR
     self.gpg_homedir = DEFAULT_LICENSE_GPG_DIR
     try:
         self.license_dir = self.core.config.get('license', 'license_dir')
         self.gpg_homedir = self.core.config.get('license', 'gpg_homedir')
     except Exception, err:
         self.error("Missing or incorrect 'license' configuration in /etc "
                    "Rpcd configuration file (%s)." %
                    exceptionAsUnicode(err))
Example #5
0
 def init(self, core):
     AbstractNuConfComponent.init(self, core)
     # do not place this as a static declaration, this will be overidden by others
     if not os.path.exists(self.get_initscript()):
         raise RpcdError(tr("The %s initialization script is not present"), self.get_initscript())