summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-07-19 21:49:47 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-07-19 21:49:47 +0000
commit2fbb9258d1bd069ff4ba07fd1765201da1afa669 (patch)
tree2f8ec065cc75090e4586699b0b05611a83c16b3e /src/lib
parent71b8f65a9e37f18ac626ad2b6feeb54ff1f2d432 (diff)
downloadbcfg2-2fbb9258d1bd069ff4ba07fd1765201da1afa669.tar.gz
bcfg2-2fbb9258d1bd069ff4ba07fd1765201da1afa669.tar.bz2
bcfg2-2fbb9258d1bd069ff4ba07fd1765201da1afa669.zip
Implement altsrc support, fix humorous misspelling of instantiation
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3508 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Core.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index 4a3a09620..a1061cf08 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -241,7 +241,7 @@ class Core(object):
except PluginInitError:
logger.error("Failed to instantiate plugin %s" % (plugin))
except:
- logger.error("Unexpected initiantiation failure for plugin %s" % (plugin), exc_info=1)
+ logger.error("Unexpected instantiation failure for plugin %s" % (plugin), exc_info=1)
self.metadata = self.plugins['Metadata']
for plugin in structures:
@@ -273,6 +273,20 @@ class Core(object):
def Bind(self, entry, metadata):
'''Bind an entry using the appropriate generator'''
+ if 'altsrc' in entry.attrib:
+ oldname = entry.get('name')
+ try:
+ ret = self.Bind(self, entry, metadata)
+ entry.set('name', oldname)
+ return ret
+ except:
+ entry.set('name', oldname)
+ logger.error("Failed binding entry %s:%s with altsrc %s" \
+ % (entry.tag, entry.get('name'),
+ entry.get('altsrc')))
+ logger.error("Falling back to %s:%s" % (entry.tag,
+ entry.get('name')))
+
glist = [gen for gen in self.generators if
gen.Entries.get(entry.tag, {}).has_key(entry.get('name'))]
if len(glist) == 1: