summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Metadata.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-10-04 15:10:36 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-10-04 15:10:58 -0400
commit9a6a231ccb4f509c0f6fa932c97bad647d29af50 (patch)
treeda2223d140f756cffa931b9f7143f396c48fa26d /src/lib/Bcfg2/Server/Plugins/Metadata.py
parent7f6c10db41c22b3924539aae19164a9ab9a80468 (diff)
downloadbcfg2-9a6a231ccb4f509c0f6fa932c97bad647d29af50.tar.gz
bcfg2-9a6a231ccb4f509c0f6fa932c97bad647d29af50.tar.bz2
bcfg2-9a6a231ccb4f509c0f6fa932c97bad647d29af50.zip
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.
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Metadata.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Metadata.py1
1 files changed, 1 insertions, 0 deletions
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"""