Browse Source

Merge "Remove deprecated option node_status_keep_time"

Zuul 8 months ago
parent
commit
be06e77dab

+ 0
- 7
ironic_inspector/conf/default.py View File

@@ -33,13 +33,6 @@ _OPTS = [
33 33
                default=3600,
34 34
                help=_('Timeout after which introspection is considered '
35 35
                       'failed, set to 0 to disable.')),
36
-    cfg.IntOpt('node_status_keep_time',
37
-               default=0,
38
-               help=_('For how much time (in seconds) to keep status '
39
-                      'information about nodes after introspection was '
40
-                      'finished for them. Set to 0 (the default) '
41
-                      'to disable the timeout.'),
42
-               deprecated_for_removal=True),
43 36
     cfg.IntOpt('clean_up_period',
44 37
                default=60,
45 38
                help=_('Amount of time in seconds, after which repeat clean up '

+ 1
- 10
ironic_inspector/node_cache.py View File

@@ -874,19 +874,10 @@ def find_node(**attributes):
874 874
 def clean_up():
875 875
     """Clean up the cache.
876 876
 
877
-    * Finish introspection for timed out nodes.
878
-    * Drop outdated node status information.
877
+    Finish introspection for timed out nodes.
879 878
 
880 879
     :return: list of timed out node UUID's
881 880
     """
882
-    if CONF.node_status_keep_time > 0:
883
-        status_keep_threshold = (timeutils.utcnow() - datetime.timedelta(
884
-                                 seconds=CONF.node_status_keep_time))
885
-        with db.ensure_transaction() as session:
886
-            db.model_query(db.Node, session=session).filter(
887
-                db.Node.finished_at.isnot(None),
888
-                db.Node.finished_at < status_keep_threshold).delete()
889
-
890 881
     timeout = CONF.timeout
891 882
     if timeout <= 0:
892 883
         return []

+ 0
- 24
ironic_inspector/test/unit/test_node_cache.py View File

@@ -413,30 +413,6 @@ class TestNodeCacheCleanUp(test_base.NodeTest):
413 413
                 [(istate.States.error, current_time, 'Introspection timeout')],
414 414
                 res)
415 415
 
416
-    def test_old_status(self):
417
-        CONF.set_override('node_status_keep_time', 42)
418
-        session = db.get_writer_session()
419
-        with session.begin():
420
-            db.model_query(db.Node).update(
421
-                {'finished_at': (datetime.datetime.utcnow() -
422
-                                 datetime.timedelta(seconds=100))})
423
-
424
-        self.assertEqual([], node_cache.clean_up())
425
-
426
-        self.assertEqual([], db.model_query(db.Node).all())
427
-
428
-    def test_old_status_disabled(self):
429
-        # Status clean up is disabled by default
430
-        session = db.get_writer_session()
431
-        with session.begin():
432
-            db.model_query(db.Node).update(
433
-                {'finished_at': (datetime.datetime.utcnow() -
434
-                                 datetime.timedelta(days=10000))})
435
-
436
-        self.assertEqual([], node_cache.clean_up())
437
-
438
-        self.assertNotEqual([], db.model_query(db.Node).all())
439
-
440 416
 
441 417
 class TestNodeCacheGetNode(test_base.NodeTest):
442 418
     def test_ok(self):

+ 5
- 0
releasenotes/notes/remove-opt-keep-node-status-7d6b96f1a6e498a8.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+upgrade:
3
+  - |
4
+    The deprecated configuration option ``[DEFAULT]node_status_keep_time``
5
+    was removed.

Loading…
Cancel
Save