Skip to content

Commit 1c00d64

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "[stable-only] Fix online data migrations" into unmaintained/2023.1
2 parents 3ad10ba + a3c90fb commit 1c00d64

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cinder/db/sqlalchemy/api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8704,9 +8704,8 @@ def use_quota_online_data_migration(
87048704
calculate_use_quota,
87058705
):
87068706
updated = 0
8707-
query = model_query(context, getattr(models, resource_name)).filter_by(
8708-
use_quota=None
8709-
)
8707+
query = model_query(context, getattr(models, resource_name),
8708+
read_deleted='yes').filter_by(use_quota=None)
87108709
if resource_name == 'Volume':
87118710
query = query.options(joinedload(models.Volume.volume_admin_metadata))
87128711
total = query.count()

cinder/tests/unit/test_db_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4018,7 +4018,8 @@ def test_use_quota_online_data_migration(self, query_mock, models_mock):
40184018
calculate_method)
40194019

40204020
query_mock.assert_called_once_with(self.ctxt,
4021-
models_mock.resource_name)
4021+
models_mock.resource_name,
4022+
read_deleted='yes')
40224023
query_mock.return_value.filter_by.assert_called_once_with(
40234024
use_quota=None)
40244025
query.count.assert_called_once_with()

0 commit comments

Comments
 (0)