summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-08-08 03:28:41 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-08-08 03:28:41 +0000
commitca87a4482be36dbec44ff4a1e5fa601a8506adb9 (patch)
treefc89f32ef9102842d7ea665a89cb6757191db131 /src/lib
parentb63a749228b32de44aa9744927a9ac364f136bbf (diff)
downloadbcfg2-ca87a4482be36dbec44ff4a1e5fa601a8506adb9.tar.gz
bcfg2-ca87a4482be36dbec44ff4a1e5fa601a8506adb9.tar.bz2
bcfg2-ca87a4482be36dbec44ff4a1e5fa601a8506adb9.zip
Add bind support for virtual package remappings
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3613 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Pkgmgr.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/Pkgmgr.py b/src/lib/Server/Plugins/Pkgmgr.py
index a11e237d1..7395b7930 100644
--- a/src/lib/Server/Plugins/Pkgmgr.py
+++ b/src/lib/Server/Plugins/Pkgmgr.py
@@ -129,3 +129,16 @@ class Pkgmgr(Bcfg2.Server.Plugin.PrioDir):
except KeyError:
self.Entries[itype] = FuzzyDict([(child,
self.BindEntry)])
+
+ def BindEntry(self, entry, metadata):
+ '''Bind data for entry, and remove instances that are not requested'''
+ pname = entry.get('name')
+ Bcfg2.Server.Plugin.PrioDir.BindEntry(self, entry, metadata)
+ if entry.findall('Instance'):
+ mdata = FuzzyDict.fuzzy.match(pname)
+ if mdata:
+ arches = mdata.group('alist').split(',')
+ [entry.remove(inst) for inst in \
+ entry.findall('Instance') \
+ if inst.get('arch') not in arches]
+