BIND 10 trac213, updated. db063ad7e102eafe75bda392197e9653be95bea4 [213] The forcefull argument

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Oct 24 18:25:51 UTC 2011


The branch, trac213 has been updated
       via  db063ad7e102eafe75bda392197e9653be95bea4 (commit)
      from  e23b6b271c892905c9a14386aee502610502bba4 (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 db063ad7e102eafe75bda392197e9653be95bea4
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Oct 24 20:24:00 2011 +0200

    [213] The forcefull argument
    
    To really kill a component.

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

Summary of changes:
 src/lib/python/isc/bind10/component.py            |    9 +++++++--
 src/lib/python/isc/bind10/special_component.py    |    3 ++-
 src/lib/python/isc/bind10/tests/component_test.py |    3 ++-
 3 files changed, 11 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/bind10/component.py b/src/lib/python/isc/bind10/component.py
index 6969244..39a5cc7 100644
--- a/src/lib/python/isc/bind10/component.py
+++ b/src/lib/python/isc/bind10/component.py
@@ -269,16 +269,21 @@ class Component:
         """
         return self._procinfo.pid if self._procinfo else None
 
-    def kill(self):
+    def kill(self, forcefull=False):
         """
         The component should be forcefully killed. This does not change the
         internal state, it just kills the external process and expects a
         failure to be reported when the process really dies.
 
         If it isn't running, it does nothing.
+
+        If the forcefull is true, it uses SIGKILL instead of SIGTERM.
         """
         if self._procinfo:
-            self._procinfo.kill()
+            if forcefull:
+                self._procinfo.kill()
+            else:
+                self._procinfo.terminate()
 
 class Configurator:
     """
diff --git a/src/lib/python/isc/bind10/special_component.py b/src/lib/python/isc/bind10/special_component.py
index 1ada70f..6d07187 100644
--- a/src/lib/python/isc/bind10/special_component.py
+++ b/src/lib/python/isc/bind10/special_component.py
@@ -44,7 +44,8 @@ class SockCreator(Component):
         """
         return self.__creator.pid() if self.__creator else None
 
-    def kill(self):
+    def kill(self, forcefull=False):
+        # We don't really care about forcefull here
         if self.__creator:
             self.__creator.kill()
 
diff --git a/src/lib/python/isc/bind10/tests/component_test.py b/src/lib/python/isc/bind10/tests/component_test.py
index 3f3bb87..339b39f 100644
--- a/src/lib/python/isc/bind10/tests/component_test.py
+++ b/src/lib/python/isc/bind10/tests/component_test.py
@@ -433,6 +433,7 @@ class ComponentTests(BossUtils, unittest.TestCase):
         """
         component = Component(self, 'component', 'needed')
         component.kill()
+        component.kill(True)
 
 class TestComponent(Component):
     """
@@ -468,7 +469,7 @@ class TestComponent(Component):
     def _failed_internal(self):
         self.log('failed')
 
-    def kill(self):
+    def kill(self, forcefull=False):
         self.log('killed')
 
 class FailComponent(Component):




More information about the bind10-changes mailing list