summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages/PackagesConfig.py
blob: 3846c06ce3161a90020e01ada1e3347e24584dab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Bcfg2.Server.Plugin

class PackagesConfig(Bcfg2.Server.Plugin.SimpleConfig):
    _required = False

    def Index(self):
        """ Build local data structures """
        Bcfg2.Server.Plugin.SimpleConfig.Index(self)

        if hasattr(self.plugin, "sources") and self.plugin.sources.loaded:
            # only reload Packages plugin if sources have been loaded.
            # otherwise, this is getting called on server startup, and
            # we have to wait until all sources have been indexed
            # before we can call Packages.Reload()
            self.plugin.Reload()