BIND 10 trac2244, updated. 7b053fd99e6503d3a0a8fb7dbb9d3139df942565 [2244] renamed BaseComponent.is_failed() to is_restarting().

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Oct 8 23:18:07 UTC 2012


The branch, trac2244 has been updated
       via  7b053fd99e6503d3a0a8fb7dbb9d3139df942565 (commit)
       via  04db154ec2fdd1d768fe716b0ccabaa1660e872b (commit)
      from  7a40926af1fd90e0fd685a8db05795f699560245 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7b053fd99e6503d3a0a8fb7dbb9d3139df942565
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Oct 8 16:14:16 2012 -0700

    [2244] renamed BaseComponent.is_failed() to is_restarting().
    
    so it sounds more natural as an English term.

commit 04db154ec2fdd1d768fe716b0ccabaa1660e872b
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Oct 8 15:49:24 2012 -0700

    [2244] fixed a typo in a log message.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/bind10/bind10_messages.mes                |    2 +-
 src/lib/python/isc/bind10/component.py            |   14 +++++++-------
 src/lib/python/isc/bind10/tests/component_test.py |   12 ++++++------
 3 files changed, 14 insertions(+), 14 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/bind10/bind10_messages.mes b/src/bin/bind10/bind10_messages.mes
index dd36ef9..2f48325 100644
--- a/src/bin/bind10/bind10_messages.mes
+++ b/src/bin/bind10/bind10_messages.mes
@@ -147,7 +147,7 @@ unexpectedly, but the boss then found that the component had been removed
 from its local configuration of components to run.  This is an unusal
 situation but can happen if the administrator removes the component from
 the configuration after the component's crash and before the restart time.
-The boss module simply skipped restarting that module, and the whole syste
+The boss module simply skipped restarting that module, and the whole system
 went back to the expected state (except that the crash itself is likely
 to be a bug).
 
diff --git a/src/lib/python/isc/bind10/component.py b/src/lib/python/isc/bind10/component.py
index 6b96b94..1f7006c 100644
--- a/src/lib/python/isc/bind10/component.py
+++ b/src/lib/python/isc/bind10/component.py
@@ -45,7 +45,7 @@ COMPONENT_RESTART_DELAY = 10
 
 STATE_DEAD = 'dead'
 STATE_STOPPED = 'stopped'
-STATE_FAILED = 'failed'
+STATE_RESTARTING = 'restarting'
 STATE_RUNNING = 'running'
 
 def get_signame(signal_number):
@@ -69,7 +69,7 @@ class BaseComponent:
       explicitly).
     - Running - after start() was called, it started successfully and is
       now running.
-    - Failed - the component failed (crashed) and is waiting for a restart
+    - Restarting - the component failed (crashed) and is waiting for a restart
     - Dead - it failed and can not be resurrected.
 
     Init
@@ -85,7 +85,7 @@ class BaseComponent:
                     +<-----------+                |
                     |                             |
                     |  kind == dispensable or kind|== needed and failed late
-                    +-----------------------> Failed
+                    +-----------------------> Restarting
                     |
                     | kind == core or kind == needed and it failed too soon
                     v
@@ -238,7 +238,7 @@ class BaseComponent:
                      exit_str)
         if not self.is_running():
             raise ValueError("Can't fail component that isn't running")
-        self.__state = STATE_FAILED
+        self.__state = STATE_RESTARTING # tentatively set, maybe changed to DEAD
         self._failed_internal()
         # If it is a core component or the needed component failed to start
         # (including it stopped really soon)
@@ -298,14 +298,14 @@ class BaseComponent:
         """
         return self.__state == STATE_RUNNING
 
-    def is_failed(self):
+    def is_restarting(self):
         """Informs if the component has failed and is waiting for a restart.
 
         Unlike the case of is_running(), if this returns True it always means
         the corresponding process has died and not yet restarted.
 
         """
-        return self.__state == STATE_FAILED
+        return self.__state == STATE_RESTARTING
 
     def _start_internal(self):
         """
@@ -609,7 +609,7 @@ class Configurator:
         for cname in old.keys():
             if cname not in new:
                 component = self._components[cname][1]
-                if component.is_running() or component.is_failed():
+                if component.is_running() or component.is_restarting():
                     plan.append({
                         'command': STOP_CMD,
                         'component': component,
diff --git a/src/lib/python/isc/bind10/tests/component_test.py b/src/lib/python/isc/bind10/tests/component_test.py
index 339a939..18efea7 100644
--- a/src/lib/python/isc/bind10/tests/component_test.py
+++ b/src/lib/python/isc/bind10/tests/component_test.py
@@ -192,7 +192,7 @@ class ComponentTests(BossUtils, unittest.TestCase):
         self.assertFalse(self.__stop_called)
         self.assertFalse(self.__failed_called)
         self.assertFalse(component.is_running())
-        self.assertFalse(component.is_failed())
+        self.assertFalse(component.is_restarting())
         # We can't stop or fail the component yet
         self.assertRaises(ValueError, component.stop)
         self.assertRaises(ValueError, component.failed, 1)
@@ -206,7 +206,7 @@ class ComponentTests(BossUtils, unittest.TestCase):
         self.assertFalse(self.__stop_called)
         self.assertFalse(self.__failed_called)
         self.assertTrue(component.is_running())
-        self.assertFalse(component.is_failed())
+        self.assertFalse(component.is_restarting())
 
     def __check_dead(self, component):
         """
@@ -218,7 +218,7 @@ class ComponentTests(BossUtils, unittest.TestCase):
         self.assertTrue(self.__failed_called)
         self.assertEqual(1, self._exitcode)
         self.assertFalse(component.is_running())
-        self.assertFalse(component.is_failed())
+        self.assertFalse(component.is_restarting())
         # Surely it can't be stopped when already dead
         self.assertRaises(ValueError, component.stop)
         # Nor started
@@ -238,7 +238,7 @@ class ComponentTests(BossUtils, unittest.TestCase):
         self.assertFalse(self.__stop_called)
         self.assertTrue(self.__failed_called)
         self.assertTrue(component.is_running())
-        self.assertFalse(component.is_failed())
+        self.assertFalse(component.is_restarting())
         # Check it can't be started again
         self.assertRaises(ValueError, component.start)
 
@@ -251,7 +251,7 @@ class ComponentTests(BossUtils, unittest.TestCase):
         self.assertFalse(self.__stop_called)
         self.assertTrue(self.__failed_called)
         self.assertFalse(component.is_running())
-        self.assertTrue(component.is_failed())
+        self.assertTrue(component.is_restarting())
 
     def __do_start_stop(self, kind):
         """
@@ -276,7 +276,7 @@ class ComponentTests(BossUtils, unittest.TestCase):
         self.assertTrue(self.__stop_called)
         self.assertFalse(self.__failed_called)
         self.assertFalse(component.is_running())
-        self.assertFalse(component.is_failed())
+        self.assertFalse(component.is_restarting())
         # Check it can't be stopped twice
         self.assertRaises(ValueError, component.stop)
         # Or failed



More information about the bind10-changes mailing list