summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Metadata.py
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2011-01-23 11:31:11 -0600
committerTim Laszlo <tim.laszlo@gmail.com>2011-01-23 11:31:11 -0600
commit98643130324d5523e2c819a0d6499ff88e5a6673 (patch)
treeef97b8b5d4185bf0b96eba638b5a17d3231a00bb /src/lib/Server/Plugins/Metadata.py
parent2f261098fcbe6377d952559e2c1566824a7e3eeb (diff)
downloadbcfg2-98643130324d5523e2c819a0d6499ff88e5a6673.tar.gz
bcfg2-98643130324d5523e2c819a0d6499ff88e5a6673.tar.bz2
bcfg2-98643130324d5523e2c819a0d6499ff88e5a6673.zip
Metadata: Gracefully handle failed profile updates to clients.xml using xinclude files
Diffstat (limited to 'src/lib/Server/Plugins/Metadata.py')
-rw-r--r--src/lib/Server/Plugins/Metadata.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index fe4d57361..fde0ab77c 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -468,7 +468,11 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
if client in self.clients:
self.logger.info("Changing %s group from %s to %s" % (client, self.clients[client], profile))
cli = self.clientdata_original.xpath('.//Client[@name="%s"]' % (client))
- cli[0].set('profile', profile)
+ if len(cli) > 0:
+ cli[0].set('profile', profile)
+ else:
+ """Try to find the client in included files"""
+ self.logger.error("Metadata: Unable to update profile for client %s. Use of Xinclude?" % client)
else:
self.logger.info("Creating new client: %s, profile %s" % \
(client, profile))