summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-09-15 20:26:18 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-09-15 20:26:18 +0000
commit658ce802833b4770b9a1970b779d4a5a85bdd4bf (patch)
tree0e13c09dd58b9dc00263bcb35fdd73f035b9f4f4 /src
parentc43f0ea5b25fd30d757f800b114e68242fcfd715 (diff)
downloadbcfg2-658ce802833b4770b9a1970b779d4a5a85bdd4bf.tar.gz
bcfg2-658ce802833b4770b9a1970b779d4a5a85bdd4bf.tar.bz2
bcfg2-658ce802833b4770b9a1970b779d4a5a85bdd4bf.zip
Packages: Implement remote cache update call
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5437 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-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')