... to reduce code duplication.

Signed-off-by: Jose A. Lopes <[email protected]>
---
 lib/backend.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/backend.py b/lib/backend.py
index cc751af..98acdf0 100644
--- a/lib/backend.py
+++ b/lib/backend.py
@@ -556,10 +556,7 @@ def LeaveCluster(modify_ssh_setup):
   except: # pylint: disable=W0702
     logging.exception("Error while removing cluster secrets")
 
-  result = utils.RunCmd([pathutils.DAEMON_UTIL, "stop", constants.CONFD])
-  if result.failed:
-    logging.error("Command %s failed with exitcode %s and error %s",
-                  result.cmd, result.exit_code, result.output)
+  utils.StopDaemon(constants.CONFD)
 
   # Raise a custom exception (handled in ganeti-noded)
   raise errors.QuitGanetiException(True, "Shutdown scheduled")
-- 
2.0.0.526.g5318336

Reply via email to