diff options
author | Tim Laszlo <tim.laszlo@gmail.com> | 2011-01-23 11:31:11 -0600 |
---|---|---|
committer | Tim Laszlo <tim.laszlo@gmail.com> | 2011-01-23 11:31:11 -0600 |
commit | 98643130324d5523e2c819a0d6499ff88e5a6673 (patch) | |
tree | ef97b8b5d4185bf0b96eba638b5a17d3231a00bb | |
parent | 2f261098fcbe6377d952559e2c1566824a7e3eeb (diff) | |
download | bcfg2-98643130324d5523e2c819a0d6499ff88e5a6673.tar.gz bcfg2-98643130324d5523e2c819a0d6499ff88e5a6673.tar.bz2 bcfg2-98643130324d5523e2c819a0d6499ff88e5a6673.zip |
Metadata: Gracefully handle failed profile updates to clients.xml using xinclude files
-rw-r--r-- | src/lib/Server/Plugins/Metadata.py | 6 |
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)) |