[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7484/8267] bitbake: cookerdata: Avoid tracebacks from early reset() calls



commit 0b331bc4c97e29c47dcb6b4df9ee9a99795dd948
Author: Richard Purdie <richard purdie linuxfoundation org>
Date:   Thu Aug 31 17:11:46 2017 +0100

    bitbake: cookerdata: Avoid tracebacks from early reset() calls
    
    cooker.reset() can be called before we've actually setup the datastore. Gracefully
    handle this case instead of the current traceback+exit.
    
    (Bitbake rev: 8fd30ca6d271c125a8ea03ef0c5d7ab176900701)
    
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 bitbake/lib/bb/cookerdata.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index d105ab7..2c9019f 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -327,6 +327,9 @@ class CookerDataBuilder(object):
         self.mcdata[''] = self.data
 
     def reset(self):
+        # We may not have run parseBaseConfiguration() yet
+        if not hasattr(self, 'origdata'):
+            return
         self.data = bb.data.createCopy(self.origdata)
         self.mcdata[''] = self.data
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]