summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-01-08 01:31:05 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-01-08 01:31:05 +0000
commit67d50c4f86d3aa0612f179de59061ff3d32aa86e (patch)
tree09638cb16ac3ec5863e91b6606e683d72a5e788c /src/lib
parenta94af81bce14b39bde5f1e73f31a79756fc2b5bd (diff)
downloadbcfg2-67d50c4f86d3aa0612f179de59061ff3d32aa86e.tar.gz
bcfg2-67d50c4f86d3aa0612f179de59061ff3d32aa86e.tar.bz2
bcfg2-67d50c4f86d3aa0612f179de59061ff3d32aa86e.zip
Pull internal option parsing out of Core
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4198 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Core.py20
-rw-r--r--src/lib/Server/Plugins/Metadata.py2
2 files changed, 5 insertions, 17 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index 56f4087dd..5b7678cd3 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -8,8 +8,6 @@ from Bcfg2.Server.Statistics import Statistics
import logging, lxml.etree, os, stat
import Bcfg2.Server.Plugins.Metadata
-import Bcfg2.Options
-
logger = logging.getLogger('Bcfg2.Core')
def ShouldIgnore(event):
@@ -200,18 +198,10 @@ except ImportError:
class Core(object):
'''The Core object is the container for all Bcfg2 Server logic, and modules'''
- options = {'repo': Bcfg2.Options.SERVER_REPOSITORY,
- 'svn': Bcfg2.Options.SERVER_SVN,
- 'structures': Bcfg2.Options.SERVER_STRUCTURES,
- 'generators': Bcfg2.Options.SERVER_GENERATORS,
- 'password': Bcfg2.Options.SERVER_PASSWORD}
- def __init__(self):
+ def __init__(self, repo, structures, generators, password, svn):
object.__init__(self)
- opts = Bcfg2.Options.OptionParser(self.options)
- opts.parse([])
- self.datastore = opts['repo']
- self.opts = opts
+ self.datastore = repo
try:
self.fam = monitor()
except IOError:
@@ -222,8 +212,8 @@ class Core(object):
self.cron = {}
self.plugins = {}
self.revision = '-1'
-
- self.svn = opts['svn']
+ self.password = password
+ self.svn = svn
try:
if self.svn:
self.read_svn_revision()
@@ -232,8 +222,6 @@ class Core(object):
self.stats = Statistics("%s/etc/statistics.xml" % (self.datastore))
- structures = opts['structures']
- generators = opts['generators']
[data.remove('') for data in [structures, generators] if '' in data]
for plugin in structures + generators + ['Metadata']:
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index 9e991251b..d2e7ad7c7 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -67,7 +67,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin):
self.ptimes = {}
self.pctime = 0
self.extra = {'groups.xml':[], 'clients.xml':[]}
- self.password = core.opts['password']
+ self.password = core.password
def HandleEvent(self, event):
'''Handle update events for data files'''