summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Generators/servicemgr.py
blob: 2e7a480ae73bf05e7622a58b9d512bad2ddcf498 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python

from Bcfg2.Server.Generator import Generator
from Bcfg2.Server.GeneratorUtils import SingleXMLFileBacked

class ServiceList(SingleXMLFileBacked):
    pass

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

    def __setup__(self):
        self.__provides__ = {'Service':{'sshd':self.GetService}}
        #self.datafile = ServiceList("%s/packages.xml"%(self.data))
        pass

    def GetService(self,entry,metadata):
        # for now sshd is on
        if entry.attrib['name'] == 'sshd':
            entry.attrib['status'] = 'on'