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
(cherry picked from commit d955ce42cc)
tags/19.0.1
Takashi NATSUME 6 months ago
parent
commit
2bbd7f4a0c
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
 
@@ -1652,8 +1653,11 @@ class TestMoveAllocations(SchedulerReportClientTestCase):
1652 1653
             }
1653 1654
         }
1654 1655
 
1655
-        resp = self.client.move_allocations(
1656
-            self.context, self.source_consumer_uuid, self.target_consumer_uuid)
1656
+        with fixtures.EnvironmentVariable('OS_DEBUG', '1'):
1657
+            with nova_fixtures.StandardLogging() as stdlog:
1658
+                resp = self.client.move_allocations(
1659
+                    self.context, self.source_consumer_uuid,
1660
+                    self.target_consumer_uuid)
1657 1661
 
1658 1662
         self.assertTrue(resp)
1659 1663
         self.mock_post.assert_called_once_with(
@@ -1661,7 +1665,7 @@ class TestMoveAllocations(SchedulerReportClientTestCase):
1661 1665
             version=self.expected_microversion,
1662 1666
             global_request_id=self.context.global_id)
1663 1667
         self.assertIn('Overwriting current allocation',
1664
-                      self.stdlog.logger.output)
1668
+                      stdlog.logger.output)
1665 1669
 
1666 1670
     @mock.patch('time.sleep')
1667 1671
     def test_409_concurrent_provider_update(self, mock_sleep):

Loading…
Cancel
Save