summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/models.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2014-11-11 13:22:30 -0600
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2014-11-11 13:22:30 -0600
commit30634d07d5489f260f37cc86d150315f02c40865 (patch)
tree9769d560cce0dacda0360dfc434f33774cb01f5e /src/lib/Bcfg2/Server/models.py
parentaae0bafb03ee6e986c51436ec749bbadd97a2f7f (diff)
downloadbcfg2-30634d07d5489f260f37cc86d150315f02c40865.tar.gz
bcfg2-30634d07d5489f260f37cc86d150315f02c40865.tar.bz2
bcfg2-30634d07d5489f260f37cc86d150315f02c40865.zip
removed duplicate plugins option
Diffstat (limited to 'src/lib/Bcfg2/Server/models.py')
-rw-r--r--src/lib/Bcfg2/Server/models.py30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/lib/Bcfg2/Server/models.py b/src/lib/Bcfg2/Server/models.py
index 7150c245a..8d6642a25 100644
--- a/src/lib/Bcfg2/Server/models.py
+++ b/src/lib/Bcfg2/Server/models.py
@@ -4,39 +4,19 @@ import sys
import logging
import Bcfg2.Options
import Bcfg2.Server.Plugins
-from Bcfg2.Compat import walk_packages
-LOGGER = logging.getLogger('Bcfg2.Server.models')
+LOGGER = logging.getLogger(__name__)
MODELS = []
-def _get_all_plugins():
- rv = []
- for submodule in walk_packages(path=Bcfg2.Server.Plugins.__path__,
- prefix="Bcfg2.Server.Plugins."):
- module = submodule[1].rsplit('.', 1)[-1]
- if submodule[1] == "Bcfg2.Server.Plugins.%s" % module:
- # we only include direct children of
- # Bcfg2.Server.Plugins -- e.g., all_plugins should
- # include Bcfg2.Server.Plugins.Cfg, but not
- # Bcfg2.Server.Plugins.Cfg.CfgInfoXML
- rv.append(module)
- return rv
-
-
-_ALL_PLUGINS = _get_all_plugins()
-
-
class _OptionContainer(object):
+ """Options for Bcfg2 database models."""
+
# we want to provide a different default plugin list --
# namely, _all_ plugins, so that the database is guaranteed to
# work, even if /etc/bcfg2.conf isn't set up properly
- options = [
- Bcfg2.Options.Option(
- cf=('server', 'plugins'), type=Bcfg2.Options.Types.comma_list,
- default=_ALL_PLUGINS, dest="models_plugins",
- action=Bcfg2.Options.PluginsAction)]
+ options = [Bcfg2.Options.Common.plugins]
@staticmethod
def options_parsed_hook():
@@ -58,7 +38,7 @@ def load_models(plugins=None):
global MODELS
if not plugins:
- plugins = Bcfg2.Options.setup.models_plugins
+ plugins = Bcfg2.Options.setup.plugins
if MODELS:
# load_models() has been called once, so first unload all of