本文整理汇总了Python中mmc.support.config.PluginConfig类的典型用法代码示例。如果您正苦于以下问题:Python PluginConfig类的具体用法?Python PluginConfig怎么用?Python PluginConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: readConf
def readConf(self):
"""
Read the module configuration
"""
PluginConfig.readConf(self)
# API Package
if self.has_option("user_package_api", "server"):
self.upaa_server = self.get("user_package_api", "server")
if self.has_option("user_package_api", "port"):
self.upaa_port = self.get("user_package_api", "port")
if self.has_option("user_package_api", "mountpoint"):
self.upaa_mountpoint = self.get("user_package_api", "mountpoint")
if self.has_option("user_package_api", "username"):
if not isTwistedEnoughForLoginPass():
logging.getLogger().warning("your version of twisted is not high enough to use login (user_package_api/username)")
self.upaa_username = ""
else:
self.upaa_username = self.get("user_package_api", "username")
if self.has_option("user_package_api", "password"):
if not isTwistedEnoughForLoginPass():
logging.getLogger().warning("your version of twisted is not high enough to use password (user_package_api/password)")
self.upaa_password = ""
else:
self.upaa_password = self.get("user_package_api", "password")
if self.has_option("user_package_api", "tmp_dir"):
self.tmp_dir = self.get("user_package_api", "tmp_dir")
if self.has_option("user_package_api", "enablessl"):
self.upaa_enablessl = self.getboolean("user_package_api", "enablessl")
if self.upaa_enablessl:
if self.has_option("user_package_api", "verifypeer"):
self.upaa_verifypeer = self.getboolean("user_package_api", "verifypeer")
if self.upaa_verifypeer: # we need twisted.internet.ssl.Certificate to activate certs
if self.has_option("user_package_api", "cacert"):
self.upaa_cacert = self.get("user_package_api", "cacert")
if self.has_option("user_package_api", "localcert"):
self.upaa_localcert = self.get("user_package_api", "localcert")
if not os.path.isfile(self.upaa_localcert):
raise Exception('can\'t read SSL key "%s"' % (self.upaa_localcert))
if not os.path.isfile(self.upaa_cacert):
raise Exception('can\'t read SSL certificate "%s"' % (self.upaa_cacert))
import twisted.internet.ssl
if not hasattr(twisted.internet.ssl, "Certificate"):
raise Exception('I need at least Python Twisted 2.5 to handle peer checking')
# Appstream settings
if self.has_option("appstream", "url"):
self.appstream_url = self.get("appstream", "url")
开发者ID:jfmorcillo,项目名称:mmc,代码行数:50,代码来源:config.py
示例17: readConf
def readConf(self):
PluginConfig.readConf(self)
try: self.diskquotaenable = self.getboolean("diskquota", "enable")
except: pass
try: self.networkquotaenable = self.getboolean("networkquota", "enable")
except: pass
self.devicemap = self.get("diskquota", "devicemap").split(',')
self.inodesperblock = self.getfloat("diskquota", "inodesperblock")
self.softquotablocks = self.getfloat("diskquota", "softquotablocks")
self.softquotainodes = self.getfloat("diskquota", "softquotainodes")
self.setquotascript = self.get("diskquota", "setquotascript")
self.delquotascript = self.get("diskquota", "delquotascript")
self.runquotascript = self.get("diskquota", "runquotascript")
self.networkmap = self.get("networkquota", "networkmap").split(',')
开发者ID:vmasilva,项目名称:mmc,代码行数:14,代码来源:__init__.py
示例18: readConf
def readConf(self):
PluginConfig.readConf(self)
DatabaseConfig.setup(self, self.conffile)
try:
self.historization = self.get('data', 'historization')
except (NoOptionError, NoSectionError):
self.historization = '15 2 * * *'
try:
self.indicators = self.get('data', 'indicators')
except (NoOptionError, NoSectionError):
self.indicators = 'indicators.xml'
try:
self.updateTemplate = self.get('data', 'updateTemplate')
except (NoOptionError, NoSectionError):
self.updateTemplate = 'default.xml'
开发者ID:pavelpromin,项目名称:mmc,代码行数:15,代码来源:config.py
示例19: readConf
def readConf(self):
PluginConfig.readConf(self)
self.external_zones_names = self.get('main', 'external_zones_names').split(" ")
self.internal_zones_names = self.get('main', 'internal_zones_names').split(" ")
try:
self.path = self.get('main', 'path')
except NoOptionError:
self.path = '/etc/shorewall'
try:
self.macros_path = self.get('main', 'macros_path')
except NoOptionError:
self.macros_path = '/usr/share/shorewall'
try:
self.macros_list = self.get('main', 'macros_list').replace(' ', '').split(',')
except NoOptionError:
self.macros_list = []
开发者ID:neoclust,项目名称:pulse,代码行数:16,代码来源:config.py
示例20: readConf
def readConf(self):
"""
Read the configuration file using the ConfigParser API.
"""
PluginConfig.readConf(self)
# Read LDAP Password Policy configuration
self.ppolicyAttributes = {}
self.ppolicydn = self.get("ppolicy", "ppolicyDN")
self.ppolicydefault = self.get("ppolicy", "ppolicyDefault")
self.ppolicydefaultdn = "cn=" + self.ppolicydefault + "," + self.ppolicydn
for attribute in self.items("ppolicyattributes"):
if attribute[1] == "True":
self.ppolicyAttributes[attribute[0]] = True
elif attribute[1] == "False":
self.ppolicyAttributes[attribute[0]] = False
else:
self.ppolicyAttributes[attribute[0]] = attribute[1]
开发者ID:vmasilva,项目名称:mmc,代码行数:17,代码来源:__init__.py
注:本文中的mmc.support.config.PluginConfig类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论