当前位置: 首页>>代码示例>>Python>>正文


Python config.PluginConfig类代码示例

本文整理汇总了Python中mmc.support.config.PluginConfig的典型用法代码示例。如果您正苦于以下问题:Python PluginConfig类的具体用法?Python PluginConfig怎么用?Python PluginConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PluginConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: readConf

 def readConf(self):
     logger = logging.getLogger()
     PluginConfig.readConf(self)
     try: self.vDomainSupport = self.getboolean("main", "vDomainSupport")
     except: pass
     if self.vDomainSupport:
         self.vDomainDN = self.get("main", "vDomainDN")
     try: self.vAliasesSupport = self.getboolean("main", "vAliasesSupport")
     except: pass
     if self.vAliasesSupport:
         self.vAliasesDN = self.get("main", "vAliasesDN")
     try:
         self.zarafa = self.getboolean("main", "zarafa")
     except NoOptionError:
         pass
     try:
         self.attrs = dict(self.items("mapping"))
     except NoSectionError:
         self.attrs = {}
     attrs = ["mailalias", "maildrop", "mailenable", "mailbox", "mailuserquota", "mailhost", "mailproxy"]
     # validate attribute mapping
     for attr, val in self.attrs.copy().items():
         if not attr in attrs:
             del self.attrs[attr]
             logger.error("Can't map attribute %s. Attribute not supported." % attr)
     # add all other attributes
     for attr in attrs:
         if not attr in self.attrs:
             self.attrs[attr] = attr
开发者ID:AnatomicJC,项目名称:mmc,代码行数:29,代码来源:__init__.py

示例2: readConf

    def readConf(self):
        PluginConfig.readConf(self)

        try:
            self.samba_prefix = self.get("main", "sambaPrefix")
        except NoOptionError:
            pass

        try:
            self.conf_file = self.get("main", "sambaConfFile")
        except NoOptionError:
            pass

        try:
            self.db_dir = self.get("main", "sambaDBDir")
        except NoOptionError:
            pass

        self.defaultSharesPath = self.get("main", "defaultSharesPath")

        try:
            listSharePaths = self.get("main", "authorizedSharePaths")
            self.authorizedSharePaths = listSharePaths.replace(' ',
                                                               '').split(',')
        except NoOptionError:
            self.authorizedSharePaths = [self.defaultSharesPath]
开发者ID:neoclust,项目名称:pulse,代码行数:26,代码来源:config.py

示例3: setDefault

 def setDefault(self):
     PluginConfig.setDefault(self)
     self.squidReload = "/etc/init.d/squid reload"
     self.squidUser = "proxy"
     self.squidGroup = "proxy"
     self.sgBinary = "/usr/bin/squidGuard"
     self.sgBlacklist = "/var/lib/squidguard/db/bad.destdomainlist"
开发者ID:AnatomicJC,项目名称:mmc,代码行数:7,代码来源:__init__.py

示例4: setDefault

 def setDefault(self):
     PluginConfig.setDefault(self)
     self.authmethod = "baseldap"
     self.provmethod = None
     self.computersmethod = "none"
     self.passwordscheme = "ssha"
     self.auditmethod = "none"
开发者ID:AnatomicJC,项目名称:mmc,代码行数:7,代码来源:config.py

示例5: readConf

    def readConf(self):
        """
        Read web section of the imaging plugin configuration file
        """
        PluginConfig.readConf(self)
        if not self.disabled:
            ImagingDatabaseConfig.setup(self, self.conffile)
            if self.has_section("web"):
                for option in self.options("web"):
                    # option variable is lowercase
                    setattr(self, option, self.get("web", option))

        setattr(self, "network", "resolv_order")
        if not type(self.resolv_order) == type([]):
            self.resolv_order = self.resolv_order.split(' ')

        if self.has_option("network", "preferred_network"):
            self.preferred_network = self.get("network", "preferred_network")
        else :
            self.preferred_network = ''

        try:
            self.purge_interval = self.get('main', 'purge_interval')
        except (NoOptionError, NoSectionError):
            self.purge_interval = '23 0 * * 0'
开发者ID:inkhey,项目名称:mmc,代码行数:25,代码来源:config.py

示例6: readConf

 def readConf(self):
     PluginConfig.readConf(self)
     DatabaseConfig.setup(self, self.conffile)
     #update_command
     try:
         self.update_commands_cron = self.get(
             'main', 'update_commands_cron')
     except (NoOptionError, NoSectionError):
         self.update_commands_cron = '10 12 * * *'
     try:
         self.enable_update_commands = int(
             self.get('main', 'enable_update_commands'))
     except:
         self.enable_update_commands = 1
     #add_update_description
     try:
         self.add_update_description_cron = self.get(
             'main', 'add_update_description_cron')
     except (NoOptionError, NoSectionError):
         self.add_update_description_cron = '0 */1 * * *'
     try:
         self.enable_update_description = int(
             self.get('main', 'enable_update_description'))
     except:
         self.enable_update_description = 1
开发者ID:pruebagit,项目名称:mmc,代码行数:25,代码来源:config.py

示例7: __init__

 def __init__(self, name="samba4"):
     # Default values
     self.samba_prefix = "/usr"
     self.conf_file = "/etc/samba/smb.conf"
     self.db_dir = "/var/lib/samba"
     self.defaultSharesPath = "/home/samba"
     self.authorizedSharePaths = [self.defaultSharesPath]
     PluginConfig.__init__(self, name)
开发者ID:neoclust,项目名称:pulse,代码行数:8,代码来源:config.py

示例8: setDefault

 def setDefault(self):
     """
     Set default values
     """
     PluginConfig.setDefault(self)
     self.dbsslenable = False
     self.dbpoolrecycle = 60
     self.dbpoolsize = 5
开发者ID:tekmans,项目名称:mmc,代码行数:8,代码来源:config.py

示例9: setDefault

 def setDefault(self):
     """
     Set good default for the module if a parameter is missing the
     configuration file.
     This function is called in the class constructor, so what you
     set here will be overwritten by the readConf method.
     """
     PluginConfig.setDefault(self)
开发者ID:neoclust,项目名称:pulse,代码行数:8,代码来源:config.py

示例10: readConf

    def readConf(self):
        PluginConfig.readConf(self)

        self.pid_path = self.safe_get("main",
                                       "pid_path",
                                       self.pid_path)
        self.ssh_path = self.safe_get("main",
                                       "ssh_path",
                                       self.ssh_path)
        self.support_url = self.safe_get("main",
                                         "support_url",
                                          self.support_url)
        self.support_user = self.safe_get("main",
                                          "support_user",
                                           self.support_user)
        self.identify_file = self.safe_get("main",
                                           "identify_file",
                                           self.identify_file)

        if not os.path.exists(self.identify_file):
            logging.getLogger().warn("File %s don't exists!" % self.identify_file)

        self.url = "%[email protected]%s" % (self.support_user, self.support_url)

        self.check_pid_delay = int(self.safe_get("main",
                                                 "check_pid_delay",
                                                  self.check_pid_delay))
        self.session_timeout = int(self.safe_get("main",
                                                 "session_timeout",
                                                  self.session_timeout))

        if not os.path.exists(self.install_id_path):
            logging.getLogger().warn("File %s don't exists!" % self.install_id_path)
        else:
            with open(self.install_id_path, "r") as f:
                content = f.readlines()
                if len(content) > 0:
                    self.install_uuid = content[0].strip()


        self.license_server_url = self.safe_get("main",
                                                "license_server_url",
                                                self.license_server_url)

        self.cron_search_for_updates = self.safe_get("main",
                                                     "cron_search_for_updates",
                                                     self.cron_search_for_updates)
        self._cron_randomize()

        self.license_tmp_file = self.safe_get("main",
                                              "license_tmp_file",
                                              self.license_tmp_file)

        self.country = self.safe_get("main",
                                     "country",
                                      self.country)
开发者ID:andrewlukoshko,项目名称:mmc,代码行数:56,代码来源:config.py

示例11: readConf

 def readConf(self):
     """
     Read the configuration file using the ConfigParser API.
     The PluginConfig.readConf reads the "disable" option of the
     "main" section.
     """
     PluginConfig.readConf(self)
     BackuppcDatabaseConfig.setup(self, self.conffile)
     self.disable = self.getboolean("main", "disable")
     self.tempdir = self.get("main", "tempdir")
开发者ID:neoclust,项目名称:pulse,代码行数:10,代码来源:config.py

示例12: readConf

    def readConf(self):
        """
        Read the module configuration
        """
        PluginConfig.readConf(self)
        self.disable = self.getboolean("main", "disable")
        Pulse2DatabaseConfig.setup(self, self.conffile)

        if self.has_option("main", "location"):
            self.location = self.get("main", "location")
开发者ID:AnatomicJC,项目名称:mmc,代码行数:10,代码来源:__init__.py

示例13: readConf

 def readConf(self):
     PluginConfig.readConf(self)
     self.journalctl_path = self.get('main', 'journalctl_path')
     self.services = {}
     for plugin, services in self.items('plugins'):
         self.services[plugin] = services.split(",")
     try:
         self.blacklist = self.get('main', 'blacklist').split(',')
     except:
         self.blacklist = []
开发者ID:AnatomicJC,项目名称:mmc,代码行数:10,代码来源:config.py

示例14: readConf

 def readConf(self):
     """
     Read web section of the imaging plugin configuration file
     """
     PluginConfig.readConf(self)
     if not self.disabled:
         ImagingDatabaseConfig.setup(self, self.conffile)
         if self.has_section("web"):
             for option in self.options("web"):
                 # option variable is lowercase
                 setattr(self, option, self.get("web", option))
开发者ID:spointu,项目名称:mmc,代码行数:11,代码来源:config.py

示例15: readConf

	def readConf(self):
		PluginConfig.readConf(self)
		try: self.host = self.get("ldap", "host")
		except (NoSectionError, NoOptionError): self.host = "127.0.0.1"
		try: self.root = self.get("ldap", "rootName")
		except (NoSectionError, NoOptionError): self.root = "uid=LDAP Admin, ou=System Accounts, dc=localdomain"

		self.passw = self.get("ldap", "password")

		try: self.userdn = self.get("ldap", "baseUsersDN")
		except (NoSectionError, NoOptionError): self.userdn = "ou=People, dc=localdomain"

		try: self.groupdn = self.get("ldap", "baseGroupsDN")
		except (NoSectionError, NoOptionError): self.groupdn = "ou=Group, dc=localdomain"
开发者ID:techmago,项目名称:mmc,代码行数:14,代码来源:__init__.py


注:本文中的mmc.support.config.PluginConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。