summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugin.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-11 13:27:07 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-11 13:27:17 -0400
commitafeeb2b6430875cc3979ae4ad690d2a3efc0ac68 (patch)
tree8e68a03334c5f21cd0974c757b49ef75413d1c18 /src/lib/Bcfg2/Server/Plugin.py
parentc5b4bfd842a6f03a4c840cd32c3a99bcc57a8c48 (diff)
downloadbcfg2-afeeb2b6430875cc3979ae4ad690d2a3efc0ac68.tar.gz
bcfg2-afeeb2b6430875cc3979ae4ad690d2a3efc0ac68.tar.bz2
bcfg2-afeeb2b6430875cc3979ae4ad690d2a3efc0ac68.zip
moved plugin-specific configs to main config file; propagate "setup" object to server Core
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugin.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugin.py62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py
index d7b4baf45..ca37431a2 100644
--- a/src/lib/Bcfg2/Server/Plugin.py
+++ b/src/lib/Bcfg2/Server/Plugin.py
@@ -1211,65 +1211,3 @@ class GroupSpool(Plugin, Generator):
return
reqid = self.core.fam.AddMonitor(name, self)
self.handles[reqid] = relative
-
-class SimpleConfig(FileBacked,
- ConfigParser.SafeConfigParser):
- ''' a simple plugin config using ConfigParser '''
- _required = True
-
- def __init__(self, plugin):
- filename = os.path.join(plugin.data, plugin.name.lower() + ".conf")
- self.plugin = plugin
- self.fam = self.plugin.core.fam
- self.read_files = set()
- Bcfg2.Server.Plugin.FileBacked.__init__(self, filename)
- ConfigParser.SafeConfigParser.__init__(self)
-
- if (self._required or
- (not self._required and os.path.exists(self.name))):
- self.fam.AddMonitor(self.name, self)
-
- def Index(self):
- """ Build local data structures """
- for section in self.sections():
- self.remove_section(section)
- self.read_files.update(self.read(self.name))
-
- def get(self, section, option, **kwargs):
- """ convenience method for getting config items """
- default = None
- if 'default' in kwargs:
- default = kwargs['default']
- del kwargs['default']
- try:
- return ConfigParser.SafeConfigParser.get(self, section, option,
- **kwargs)
- except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
- if default is not None:
- return default
- else:
- raise
-
- def getboolean(self, section, option, **kwargs):
- """ convenience method for getting boolean config items """
- default = None
- if 'default' in kwargs:
- default = kwargs['default']
- del kwargs['default']
- try:
- return ConfigParser.SafeConfigParser.getboolean(self, section,
- option, **kwargs)
- except (ConfigParser.NoSectionError, ConfigParser.NoOptionError,
- ValueError):
- if default is not None:
- return default
- else:
- raise
-
- @property
- def loaded(self):
- if os.path.exists(self.name):
- return self.name in self.read_files
- else:
- return True
-