diff --git a/nova/quota.py b/nova/quota.py index 8fe142e2d5d7..241d7ecc0810 100644 --- a/nova/quota.py +++ b/nova/quota.py @@ -1312,8 +1312,8 @@ def _instances_cores_ram_count(context, project_id, user_id=None): return _instances_cores_ram_count_api_db_placement(context, project_id, user_id=user_id) - LOG.warning('Falling back to legacy quota counting method for instances, ' - 'cores, and ram') + LOG.warning('Falling back to legacy quota counting method for ' + 'instances, cores, and ram') return _instances_cores_ram_count_legacy(context, project_id, user_id=user_id) diff --git a/nova/tests/unit/test_quota.py b/nova/tests/unit/test_quota.py index 85d37be3300c..e178f0c39aea 100644 --- a/nova/tests/unit/test_quota.py +++ b/nova/tests/unit/test_quota.py @@ -2057,6 +2057,8 @@ class QuotaCountTestCase(test.NoDBTestCase): # We only log the message if someone has opted in to counting # from placement. mock_warn_log.assert_called_once() + else: + mock_warn_log.assert_not_called() # We should not have called the API DB and placement counting # method. mock_api_db_placement_count.assert_not_called()