summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Generators/servicemgr.py
blob: dfee9f224d0544efd8a3d0dc8ce6dfcd8c288163 (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
#!/usr/bin/env python

from Bcfg2.Server.Generator import Generator, 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'