Skip to contentSkip to conversation

cooker.py: fix loginfo op being set to an invalid value

PATCH New Brendan Le Foll 1 participant 1 message Nov 12, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cooker.py: fix loginfo op being set to an invalid value

loginfo "op" was being set to invalid values in saveConfigurationVar it was working because set is a python global but append is not. This replaces both the "op" with strings and removes the crash when calling appendConfigurationVar

---
 lib/bb/cooker.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bb/cooker.py +2 -2
index c6c69c3..087f72f 100644
@@ -240,7 +240,7 @@ class BBCooker:
             f.write(total)
 
         #add to history
-        loginfo = {"op":append, "file":default_file, "line":total.count("\n")}
+        loginfo = {"op":"append", "file":default_file, "line":total.count("\n")}
         self.data.appendVar(var, val, **loginfo)
 
     def saveConfigurationVar(self, var, val, default_file, op):
@@ -309,7 +309,7 @@ class BBCooker:
                 f.write(total)
 
             #add to history
-            loginfo = {"op":set, "file":default_file, "line":total.count("\n")}
+            loginfo = {"op":"set", "file":default_file, "line":total.count("\n")}
             self.data.setVar(var, val, **loginfo)
 
     def removeConfigurationVar(self, var):
Signature · 1 line
2.1.2