summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Svcmgr.py
blob: 2f2c7e5ebb142d03a279b61f632757d83033b929 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'''This generator provides service mappings'''
__revision__ = '$Revision$'

from Bcfg2.Server.Plugin import Plugin, ScopedXMLFile, PluginInitError

class Svcmgr(Plugin):
    '''This is a generator that handles service assignments'''
    __name__ = 'Svcmgr'
    __version__ = '$Id$'
    __author__ = 'bcfg-dev@mcs.anl.gov'

    def __init__(self, core, datastore):
        Plugin.__init__(self, core, datastore)
        try:
            self.svc = ScopedXMLFile("%s/etc/services.xml"%(datastore), self.core.fam)
        except OSError:
            self.LogError("Failed to load service definition file")
            raise PluginInitError
        self.Entries = self.svc.__provides__