summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-01-19 03:47:01 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-01-19 03:47:01 +0000
commite36c49b0dc93ec89db4b40f3b76c14724b7fff1f (patch)
treed6d35926c0e6e23492c5e94bee8088009b850b45 /src
parentd9b10e37fa1e9531b894634ae663f6c49621b677 (diff)
downloadbcfg2-e36c49b0dc93ec89db4b40f3b76c14724b7fff1f.tar.gz
bcfg2-e36c49b0dc93ec89db4b40f3b76c14724b7fff1f.tar.bz2
bcfg2-e36c49b0dc93ec89db4b40f3b76c14724b7fff1f.zip
updates for Cory's tg problems
(Logical change 1.192) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@814 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/sbin/Bcfg2Server21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/sbin/Bcfg2Server b/src/sbin/Bcfg2Server
index 9ed19ce66..467d1c361 100644
--- a/src/sbin/Bcfg2Server
+++ b/src/sbin/Bcfg2Server
@@ -15,7 +15,7 @@ from ConfigParser import ConfigParser
from elementtree.ElementTree import Element
from Bcfg2.Server.Core import Core
-from Bcfg2.Server.Metadata import MetadataStore
+from Bcfg2.Server.Metadata import MetadataStore, MetadataConsistencyError
from Bcfg2.Server.Statistics import Statistics
from sss.daemonize import daemonize
@@ -95,11 +95,15 @@ class BcfgServer(Server):
return Element("error", type='host resolution error')
t = time()
config = Element("Configuration", version='2.0')
- # get metadata for host
- if xml.attrib.has_key("profile") and xml.attrib.has_key("image"):
- m = self.metadata.FetchMetadata(client, image=xml.attrib['image'], profile=xml.attrib['profile'])
- else:
- m = self.metadata.FetchMetadata(client)
+ try:
+ # get metadata for host
+ if xml.attrib.has_key("profile") and xml.attrib.has_key("image"):
+ m = self.metadata.FetchMetadata(client, image=xml.attrib['image'], profile=xml.attrib['profile'])
+ else:
+ m = self.metadata.FetchMetadata(client)
+ except MetadataConsistencyError:
+ syslog(LOG_ERR, "Metadata consistency error for client %s" % client)
+ return Element("error", type='metadata error')
config.set('toolset', m.toolset)
try:
@@ -123,7 +127,10 @@ class BcfgServer(Server):
client = gethostbyaddr(peer)[0].split('.')[0]
except herror:
return Element("error", type='host resolution error')
- m = self.metadata.FetchMetadata(client)
+ try:
+ m = self.metadata.FetchMetadata(client)
+ except MetadataConsistencyError:
+ return Element("error", type='metadata resolution error')
for g in self.core.generators:
for p in g.get_probes(m):
r.append(p)