summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-18 17:50:24 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-21 07:20:14 +0100
commit67ae612ab890965357d24a9bd35610cf813b79ba (patch)
tree2d7b8c4f228ef1434ebac42581f70193eb74fb02
parent72a3dbe13a23588e24c0baca6d58c35cdeba3f63 (diff)
downloadbitbake-contrib-67ae612ab890965357d24a9bd35610cf813b79ba.tar.gz
cookerdata/cooker: Restore original datastore upon client disconnect
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/cooker.py2
-rw-r--r--lib/bb/cookerdata.py9
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index e27763eca..daffe6754 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1566,6 +1566,8 @@ class BBCooker:
def clientComplete(self):
"""Called when the client is done using the server"""
self.finishcommand()
+ self.databuilder.reset()
+ self.data = self.databuilder.data
def server_main(cooker, func, *args):
cooker.pre_serve()
diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index d05abfe74..55c6ea83c 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -328,6 +328,15 @@ class CookerDataBuilder(object):
logger.exception("Error parsing configuration files")
raise bb.BBHandledException
+ # Create a copy so we can reset at a later date when UIs disconnect
+ self.origdata = self.data
+ self.data = bb.data.createCopy(self.origdata)
+ self.mcdata[''] = self.data
+
+ def reset(self):
+ self.data = bb.data.createCopy(self.origdata)
+ self.mcdata[''] = self.data
+
def _findLayerConf(self, data):
return findConfigFile("bblayers.conf", data)