Fully ensure counts are out of scope of cxtmgr

With counts declared outside the context manager, it means values
in counts that come from the sqlalchemy results object are still in
scope when the context manager exits! Oh no!

Co-Authored-By: Clif Houck <me@clifhouck.com>
Related-Bug: https://bugs.launchpad.net/ironic/+bug/2023316
Change-Id: Ifd66444f73355d912c52905a0f04748284b25c1b
This commit is contained in:
Jay Faulkner 2023-06-26 14:26:27 -07:00
parent dd79ae5e24
commit 4a570042c9
1 changed files with 1 additions and 1 deletions

View File

@ -527,8 +527,8 @@ class MigrationCheckersMixin(object):
return data
def _check_c14cef6dfedf(self, engine, data):
counts = collections.defaultdict(int)
with engine.begin() as connection:
counts = collections.defaultdict(int)
result = connection.execute(
sqlalchemy.select(
models.Node.uuid,