summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/PostInstall.py
blob: 0a529f4fd582d6ee2f5b6be71d609db61b6189a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'''PostInstall Support'''
__revision__ = '$Revision$'

import Bcfg2.Client.Tools

class PostInstall(Bcfg2.Client.Tools.Tool):
    '''Implement PostInstalls'''
    __name__ = 'PostInstall'
    __handles__ = [('PostInstall', None)]
    __req__ = {'PostInstall': ['name']}
    
    def VerifyPostInstall(self, dummy, _):
        '''PostInstalls always verify true'''
        return True

    def BundleUpdated(self, bundle, states):
        '''Run postinstalls when bundles have been updated'''
        for entry in bundle:
            if entry.tag == 'PostInstall':
                self.cmd.run(entry.get('name'))