From 9a6a231ccb4f509c0f6fa932c97bad647d29af50 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 4 Oct 2013 15:10:36 -0400 Subject: Metadata: read in clients.xml on every write This ensures consistency between the in-memory representation of clients.xml and the representation on disk. If we don't read our writes immediately, there's a race condition when creating a new client: If it asserts its profile or version before the FAM event from the clients.xml edit is processed, then the clients doesn't appear to exist yet, and Bcfg2 complains. --- src/lib/Bcfg2/Server/Plugins/Metadata.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/Bcfg2/Server/Plugins/Metadata.py b/src/lib/Bcfg2/Server/Plugins/Metadata.py index 4a0413a55..047dd4f4e 100644 --- a/src/lib/Bcfg2/Server/Plugins/Metadata.py +++ b/src/lib/Bcfg2/Server/Plugins/Metadata.py @@ -221,6 +221,7 @@ class XMLMetadataConfig(Bcfg2.Server.Plugin.XMLFileBacked): sys.exc_info()[1]) self.logger.error(msg) raise Bcfg2.Server.Plugin.MetadataRuntimeError(msg) + self.load_xml() def find_xml_for_xpath(self, xpath): """Find and load xml file containing the xpath query""" -- cgit v1.2.3-1-g7c22