summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2004-03-01 22:19:11 +0000
committerNarayan Desai <desai@mcs.anl.gov>2004-03-01 22:19:11 +0000
commit0e452375fef74777a9d56c90261ff79be54d191b (patch)
treec4c848b0099b25beec0d8a00c86b7ab31fe576df /src
parent81c9ecc82c149e22d58930d8b339ad8d0cc2cd93 (diff)
downloadbcfg2-0e452375fef74777a9d56c90261ff79be54d191b.tar.gz
bcfg2-0e452375fef74777a9d56c90261ff79be54d191b.tar.bz2
bcfg2-0e452375fef74777a9d56c90261ff79be54d191b.zip
ditch Build method
2004/01/20 10:40:02-06:00 anl.gov!desai clean up datastore usage (Logical change 1.18) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@70 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/Generator.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/Generator.py b/src/Generator.py
index 99c6cedb8..ef4451f15 100644
--- a/src/Generator.py
+++ b/src/Generator.py
@@ -8,18 +8,17 @@ from syslog import syslog, LOG_ERR
class Generator(object):
'''This is a class that generators can be subclassed from.
__name__, __version__, and __author__ must be set for the module
- __build__ is a dictionary mapping filename to generator function
+ __provides__ is a dictionary mapping listing the entity type and name to a function name
__requires__ is a set of external published data needed for operation'''
__name__ = None
__version__ = None
- __datastore__ = '/home/desai/data/b2'
- __build__ = {}
+ __provides__ = {}
__requires__ = []
- def __init__(self, core):
+ def __init__(self, core, datastore):
self.core=core
- self.data="%s/%s"%(self.__datastore__,self.__name__)
+ self.data="%s/%s"%(datastore,self.__name__)
self.__setup__()
def __setup__(self):
@@ -34,13 +33,6 @@ class Generator(object):
'''Cron defines periodic tasks to maintain data coherence'''
pass
- def Build(self,filename,client):
- '''Build will construct a Config File object for client.'''
- if self.__build__.has_key(filename):
- return getattr(self,self.__build__[filename])(filename,client)
- else:
- raise GeneratorError, ("Key",filename)
-
def Publish(self,key,value):
self.core.Publish(self.__name__,key,value)