summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Packages.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index e3d741197..789133177 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -422,6 +422,7 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
Bcfg2.Server.Plugin.Generator):
name = 'Packages'
experimental = True
+ __rmi__ = ['update_cache']
def __init__(self, core, datastore):
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
@@ -521,6 +522,14 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
redundant.add(rpkg)
return pkgnames.difference(redundant), redundant
+ def update_cache(self):
+ for source in self.sources:
+ try:
+ source.update()
+ except:
+ self.logger.error("Failed to update source", exc_info=1)
+ source.read_files()
+
if __name__ == '__main__':
Bcfg2.Logger.setup_logging('Packages', to_console=True)
aa = Packages(None, '/home/desai/tmp/bcfg2')