Browse Source

Change a log level for overwriting allocation

Change a log level for overwriting allocation
to debug instead of warning
because the log message is output in the normal case
of reverting resize.

Change-Id: I4f2ee3f420b4c78385eeb56c7e8c343af894e75c
Closes-Bug: #1822917
tags/20.0.0.0rc1
Takashi NATSUME 6 months ago
parent
commit
d955ce42cc
2 changed files with 11 additions and 7 deletions
  1. 4
    4
      nova/scheduler/client/report.py
  2. 7
    3
      nova/tests/unit/scheduler/client/test_report.py

+ 4
- 4
nova/scheduler/client/report.py View File

@@ -1877,10 +1877,10 @@ class SchedulerReportClient(object):
1877 1877
                          'they were already moved to consumer %s',
1878 1878
                          source_consumer_uuid, target_consumer_uuid)
1879 1879
                 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})
1884 1884
 
1885 1885
         new_allocs = {
1886 1886
             source_consumer_uuid: {

+ 7
- 3
nova/tests/unit/scheduler/client/test_report.py View File

@@ -28,6 +28,7 @@ from nova import objects
28 28
 from nova.scheduler.client import report
29 29
 from nova.scheduler import utils as scheduler_utils
30 30
 from nova import test
31
+from nova.tests import fixtures as nova_fixtures
31 32
 from nova.tests.unit import fake_requests
32 33
 
33 34
 
@@ -1654,8 +1655,11 @@ class TestMoveAllocations(SchedulerReportClientTestCase):
1654 1655
             }
1655 1656
         }
1656 1657
 
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)
1659 1663
 
1660 1664
         self.assertTrue(resp)
1661 1665
         self.mock_post.assert_called_once_with(
@@ -1663,7 +1667,7 @@ class TestMoveAllocations(SchedulerReportClientTestCase):
1663 1667
             version=self.expected_microversion,
1664 1668
             global_request_id=self.context.global_id)
1665 1669
         self.assertIn('Overwriting current allocation',
1666
-                      self.stdlog.logger.output)
1670
+                      stdlog.logger.output)
1667 1671
 
1668 1672
     @mock.patch('time.sleep')
1669 1673
     def test_409_concurrent_provider_update(self, mock_sleep):

Loading…
Cancel
Save