Skip to content

Commit 014dd36

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Change a log level for overwriting allocation"
2 parents 013aa19 + d955ce4 commit 014dd36

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

nova/scheduler/client/report.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,10 +1877,10 @@ def move_allocations(self, context, source_consumer_uuid,
18771877
'they were already moved to consumer %s',
18781878
source_consumer_uuid, target_consumer_uuid)
18791879
return True
1880-
LOG.warning('Overwriting current allocation %(allocation)s on '
1881-
'consumer %(consumer)s',
1882-
{'allocation': target_alloc,
1883-
'consumer': target_consumer_uuid})
1880+
LOG.debug('Overwriting current allocation %(allocation)s on '
1881+
'consumer %(consumer)s',
1882+
{'allocation': target_alloc,
1883+
'consumer': target_consumer_uuid})
18841884

18851885
new_allocs = {
18861886
source_consumer_uuid: {

nova/tests/unit/scheduler/client/test_report.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from nova.scheduler.client import report
2929
from nova.scheduler import utils as scheduler_utils
3030
from nova import test
31+
from nova.tests import fixtures as nova_fixtures
3132
from nova.tests.unit import fake_requests
3233

3334

@@ -1654,16 +1655,19 @@ def test_move_to_non_empty_target(self):
16541655
}
16551656
}
16561657

1657-
resp = self.client.move_allocations(
1658-
self.context, self.source_consumer_uuid, self.target_consumer_uuid)
1658+
with fixtures.EnvironmentVariable('OS_DEBUG', '1'):
1659+
with nova_fixtures.StandardLogging() as stdlog:
1660+
resp = self.client.move_allocations(
1661+
self.context, self.source_consumer_uuid,
1662+
self.target_consumer_uuid)
16591663

16601664
self.assertTrue(resp)
16611665
self.mock_post.assert_called_once_with(
16621666
self.expected_url, expected_payload,
16631667
version=self.expected_microversion,
16641668
global_request_id=self.context.global_id)
16651669
self.assertIn('Overwriting current allocation',
1666-
self.stdlog.logger.output)
1670+
stdlog.logger.output)
16671671

16681672
@mock.patch('time.sleep')
16691673
def test_409_concurrent_provider_update(self, mock_sleep):

0 commit comments

Comments
 (0)