[6/7] bitbake: buildinfohelper.py fix for Django 3.2

Message ID c5e3d14d3bd984dd4ef6f75355962b51ea98278d.1647116564.git.tim.orling@konsulko.com
State New
Headers show
Series [1/7] toaster-requirements.txt: Django 3.2 LTS | expand

Commit Message

Tim Orling March 12, 2022, 8:31 p.m. UTC
connection.features.autocommits_when_autocommit_is_off
was deprecated in 3.0 and is no longer present in 3.2

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 835e92c2992..8fef6634691 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -893,9 +893,6 @@  class BuildInfoHelper(object):
         self.task_order = 0
         self.autocommit_step = 1
         self.server = server
-        # we use manual transactions if the database doesn't autocommit on us
-        if not connection.features.autocommits_when_autocommit_is_off:
-            transaction.set_autocommit(False)
         self.orm_wrapper = ORMWrapper()
         self.has_build_history = has_build_history
         self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
@@ -1313,12 +1310,11 @@  class BuildInfoHelper(object):
                 task_information['outcome'] = Task.OUTCOME_FAILED
                 del self.internal_state['taskdata'][identifier]
 
-        if not connection.features.autocommits_when_autocommit_is_off:
-            # we force a sync point here, to get the progress bar to show
-            if self.autocommit_step % 3 == 0:
-                transaction.set_autocommit(True)
-                transaction.set_autocommit(False)
-            self.autocommit_step += 1
+        # we force a sync point here, to get the progress bar to show
+        if self.autocommit_step % 3 == 0:
+            transaction.set_autocommit(True)
+            transaction.set_autocommit(False)
+        self.autocommit_step += 1
 
         self.orm_wrapper.get_update_task_object(task_information, True) # must exist
 
@@ -1990,8 +1986,6 @@  class BuildInfoHelper(object):
             # Do not skip command line build events
             self.store_log_event(tempevent,False)
 
-        if not connection.features.autocommits_when_autocommit_is_off:
-            transaction.set_autocommit(True)
 
         # unset the brbe; this is to prevent subsequent command-line builds
         # being incorrectly attached to the previous Toaster-triggered build;