[Debian-ha-commits] [pcs] 07/08: Update debian/patches

Valentin Vidic vvidic-guest at moszumanska.debian.org
Sun Nov 13 15:37:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository pcs.

commit a900c12b64356bae2e487de1acfb59d78ef84841
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Sun Nov 13 15:26:55 2016 +0100

    Update debian/patches
---
 debian/patches/0003-Fix-spelling.patch      |   5 +
 debian/patches/0005-settings.py             |  17 ++-
 debian/patches/0008-Fix-corosync-log.patch  |   7 +-
 debian/patches/0009-Fix-testsuite.patch     | 112 +++++++++++-----
 debian/patches/0010-Replace-chkconfig.patch | 198 +++++++++++++++-------------
 5 files changed, 207 insertions(+), 132 deletions(-)

diff --git a/debian/patches/0003-Fix-spelling.patch b/debian/patches/0003-Fix-spelling.patch
index 6e78eca..b50574e 100644
--- a/debian/patches/0003-Fix-spelling.patch
+++ b/debian/patches/0003-Fix-spelling.patch
@@ -1,3 +1,8 @@
+Description: Fix spelling errors reported by lintian
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Last-Update: 2016-11-13
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/pcs/pcs.8
 +++ b/pcs/pcs.8
 @@ -272,7 +272,7 @@
diff --git a/debian/patches/0005-settings.py b/debian/patches/0005-settings.py
index fefec13..5733222 100644
--- a/debian/patches/0005-settings.py
+++ b/debian/patches/0005-settings.py
@@ -1,22 +1,29 @@
+Description: Update locations of binaries for Debian
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Last-Update: 2016-11-13
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/pcs/settings.py.debian
 +++ b/pcs/settings.py.debian
-@@ -1,6 +1,6 @@
+@@ -1,7 +1,8 @@
  from pcs.settings_default import *
 -pengine_binary = "/usr/lib/DEB_HOST_MULTIARCH/pacemaker/pengine"
 -crmd_binary = "/usr/lib/DEB_HOST_MULTIARCH/pacemaker/crmd"
 -cib_binary = "/usr/lib/DEB_HOST_MULTIARCH/pacemaker/cib"
 -stonithd_binary = "/usr/lib/DEB_HOST_MULTIARCH/pacemaker/stonithd"
++service_binary = "/usr/sbin/service"
 +pengine_binary = "/usr/lib/pacemaker/pengine"
 +crmd_binary = "/usr/lib/pacemaker/crmd"
 +cib_binary = "/usr/lib/pacemaker/cib"
 +stonithd_binary = "/usr/lib/pacemaker/stonithd"
  pcsd_exec_location = "/usr/share/pcsd/"
+ sbd_config = "/etc/default/sbd"
 --- a/pcsd/settings.rb.debian
 +++ b/pcsd/settings.rb.debian
-@@ -9,8 +9,8 @@
- HEARTBEAT_AGENTS_DIR = "/usr/lib/ocf/resource.d/heartbeat/"
- PACEMAKER_AGENTS_DIR = "/usr/lib/ocf/resource.d/pacemaker/"
- NAGIOS_METADATA_DIR = '/usr/share/pacemaker/nagios/plugins-metadata/'
+@@ -5,8 +5,8 @@
+ KEY_FILE = PCSD_VAR_LOCATION + 'pcsd.key'
+ COOKIE_FILE = PCSD_VAR_LOCATION + 'pcsd.cookiesecret'
+ 
 -PENGINE = "/usr/lib/DEB_HOST_MULTIARCH/pacemaker/pengine"
 -CIB_BINARY = '/usr/lib/DEB_HOST_MULTIARCH/pacemaker/cib'
 +PENGINE = "/usr/lib/pacemaker/pengine"
diff --git a/debian/patches/0008-Fix-corosync-log.patch b/debian/patches/0008-Fix-corosync-log.patch
index 2367faf..35f53d4 100644
--- a/debian/patches/0008-Fix-corosync-log.patch
+++ b/debian/patches/0008-Fix-corosync-log.patch
@@ -1,6 +1,11 @@
+Description: Update corosync log location for Debian
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Last-Update: 2016-05-20
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/pcs/cluster.py
 +++ b/pcs/cluster.py
-@@ -730,7 +730,7 @@
+@@ -729,7 +729,7 @@
          quorum_section.add_attribute("two_node", "1")
  
      logging_section.add_attribute("to_logfile", "yes")
diff --git a/debian/patches/0009-Fix-testsuite.patch b/debian/patches/0009-Fix-testsuite.patch
index 51ddbbe..b08c25c 100644
--- a/debian/patches/0009-Fix-testsuite.patch
+++ b/debian/patches/0009-Fix-testsuite.patch
@@ -1,6 +1,12 @@
+Description: Update testsuite to work with Debian
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Forwarded: not-needed
+Last-Update: 2016-11-13
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/pcs/test/test_cluster.py
 +++ b/pcs/test/test_cluster.py
-@@ -173,7 +173,7 @@
+@@ -193,7 +193,7 @@
  
  logging {
      to_logfile: yes
@@ -9,7 +15,7 @@
      to_syslog: yes
  }
  """
-@@ -232,7 +232,7 @@
+@@ -252,7 +252,7 @@
  
  logging {
      to_logfile: yes
@@ -18,7 +24,7 @@
      to_syslog: yes
  }
  """)
-@@ -378,7 +378,7 @@
+@@ -399,7 +399,7 @@
  
  logging {
      to_logfile: yes
@@ -27,7 +33,7 @@
      to_syslog: yes
  }
  """)
-@@ -423,7 +423,7 @@
+@@ -444,7 +444,7 @@
  
  logging {
      to_logfile: yes
@@ -36,7 +42,7 @@
      to_syslog: yes
  }
  """)
-@@ -464,7 +464,7 @@
+@@ -485,7 +485,7 @@
  
  logging {
      to_logfile: yes
@@ -45,7 +51,7 @@
      to_syslog: yes
  }
  """)
-@@ -510,7 +510,7 @@
+@@ -531,7 +531,7 @@
  
  logging {
      to_logfile: yes
@@ -54,7 +60,7 @@
      to_syslog: yes
  }
  """)
-@@ -552,7 +552,7 @@
+@@ -573,7 +573,7 @@
  
  logging {
      to_logfile: yes
@@ -63,7 +69,7 @@
      to_syslog: yes
  }
  """)
-@@ -587,7 +587,7 @@
+@@ -608,7 +608,7 @@
  
  logging {
      to_logfile: yes
@@ -72,7 +78,7 @@
      to_syslog: yes
  }
  """)
-@@ -635,7 +635,7 @@
+@@ -656,7 +656,7 @@
  
  logging {
      to_logfile: yes
@@ -81,7 +87,7 @@
      to_syslog: yes
  }
  """)
-@@ -681,7 +681,7 @@
+@@ -702,7 +702,7 @@
  
  logging {
      to_logfile: yes
@@ -90,7 +96,7 @@
      to_syslog: yes
  }
  """)
-@@ -722,7 +722,7 @@
+@@ -743,7 +743,7 @@
  
  logging {
      to_logfile: yes
@@ -99,7 +105,7 @@
      to_syslog: yes
  }
  """)
-@@ -772,7 +772,7 @@
+@@ -793,7 +793,7 @@
  
  logging {
      to_logfile: yes
@@ -108,7 +114,7 @@
      to_syslog: yes
  }
  """)
-@@ -818,7 +818,7 @@
+@@ -839,7 +839,7 @@
  
  logging {
      to_logfile: yes
@@ -117,7 +123,7 @@
      to_syslog: yes
  }
  """)
-@@ -1217,7 +1217,7 @@
+@@ -1241,7 +1241,7 @@
  
  logging {
      to_logfile: yes
@@ -126,7 +132,7 @@
      to_syslog: yes
  }
  """)
-@@ -1338,7 +1338,7 @@
+@@ -1363,7 +1363,7 @@
  
  logging {
      to_logfile: yes
@@ -135,7 +141,7 @@
      to_syslog: yes
  }
  """)
-@@ -1397,7 +1397,7 @@
+@@ -1422,7 +1422,7 @@
  
  logging {
      to_logfile: yes
@@ -144,7 +150,7 @@
      to_syslog: yes
  }
  """)
-@@ -1456,7 +1456,7 @@
+@@ -1481,7 +1481,7 @@
  
  logging {
      to_logfile: yes
@@ -153,7 +159,7 @@
      to_syslog: yes
  }
  """)
-@@ -1517,7 +1517,7 @@
+@@ -1542,7 +1542,7 @@
  
  logging {
      to_logfile: yes
@@ -162,7 +168,7 @@
      to_syslog: yes
  }
  """)
-@@ -1583,7 +1583,7 @@
+@@ -1608,7 +1608,7 @@
  
  logging {
      to_logfile: yes
@@ -171,7 +177,7 @@
      to_syslog: yes
  }
  """)
-@@ -1648,7 +1648,7 @@
+@@ -1673,7 +1673,7 @@
  
  logging {
      to_logfile: yes
@@ -180,7 +186,7 @@
      to_syslog: yes
  }
  """)
-@@ -1713,7 +1713,7 @@
+@@ -1738,7 +1738,7 @@
  
  logging {
      to_logfile: yes
@@ -189,7 +195,7 @@
      to_syslog: yes
  }
  """)
-@@ -1802,7 +1802,7 @@
+@@ -1827,7 +1827,7 @@
  
  logging {
      to_logfile: yes
@@ -198,7 +204,7 @@
      to_syslog: yes
  }
  """)
-@@ -2381,7 +2381,7 @@
+@@ -2415,7 +2415,7 @@
  
  logging {
      to_logfile: yes
@@ -207,7 +213,7 @@
      to_syslog: yes
  }
  """)
-@@ -2620,7 +2620,7 @@
+@@ -2655,7 +2655,7 @@
  
  logging {
      to_logfile: yes
@@ -256,7 +262,7 @@
  
 --- a/pcs/test/test_stonith.py
 +++ b/pcs/test/test_stonith.py
-@@ -191,7 +191,7 @@
+@@ -236,7 +236,7 @@
  
          output, returnVal = pcs(
              temp_cib,
@@ -265,7 +271,7 @@
          )
          ac(output, "")
          self.assertEqual(0, returnVal)
-@@ -207,7 +207,7 @@
+@@ -252,7 +252,7 @@
   Resource: f3 (class=stonith type=fence_scsi)
    Meta Attrs: provides=unfencing 
    Operations: monitor interval=60s (f3-monitor-interval-60s)
@@ -274,7 +280,7 @@
    Meta Attrs: provides=something 
    Operations: monitor interval=60s (f4-monitor-interval-60s)
  """)
-@@ -240,7 +240,7 @@
+@@ -285,7 +285,7 @@
  
          output, returnVal = pcs(
              temp_cib,
@@ -283,7 +289,7 @@
          )
          ac(output, "")
          self.assertEqual(0, returnVal)
-@@ -259,7 +259,7 @@
+@@ -304,7 +304,7 @@
    Attributes: key=abc
    Meta Attrs: provides=unfencing 
    Operations: monitor interval=60s (f3-monitor-interval-60s)
@@ -294,15 +300,15 @@
  """)
 --- a/pcs/test/test_resource.py
 +++ b/pcs/test/test_resource.py
-@@ -2654,7 +2654,7 @@
-         assert output == " Master: D1-master-custom\n  Resource: D1 (class=ocf provider=heartbeat type=Dummy)\n   Operations: monitor interval=60s (D1-monitor-interval-60s)\n Resource: D0 (class=ocf provider=heartbeat type=Dummy)\n  Operations: monitor interval=60s (D0-monitor-interval-60s)\n Resource: D2 (class=ocf provider=heartbeat type=Dummy)\n  Operations: monitor interval=60s (D2-monitor-interval-60s)\n", [output]
- 
+@@ -2859,7 +2859,7 @@
      def testLSBResource(self):
--        output, returnVal  = pcs(temp_cib, "resource create --no-default-ops D2 lsb:network")
-+        output, returnVal  = pcs(temp_cib, "resource create --no-default-ops D2 lsb:networking")
+         output, returnVal  = pcs(
+             temp_cib,
+-            "resource create --no-default-ops D2 lsb:network"
++            "resource create --no-default-ops D2 lsb:networking"
+         )
          assert returnVal == 0
          assert output == "", [output]
- 
 --- a/pcsd/test/test_config.rb
 +++ b/pcsd/test/test_config.rb
 @@ -125,7 +125,7 @@
@@ -314,3 +320,41 @@
        ]],
        $logger.log
      )
+--- a/pcs/lib/test/test_resource_agent.py
++++ b/pcs/lib/test/test_resource_agent.py
+@@ -1040,7 +1040,7 @@
+         )
+ 
+         self.mock_runner.run.assert_called_once_with(
+-            ["/usr/libexec/pacemaker/stonithd", "metadata"]
++            ["/usr/lib/pacemaker/stonithd", "metadata"]
+         )
+ 
+ 
+@@ -1057,7 +1057,7 @@
+         )
+ 
+         self.mock_runner.run.assert_called_once_with(
+-            ["/usr/libexec/pacemaker/stonithd", "metadata"]
++            ["/usr/lib/pacemaker/stonithd", "metadata"]
+         )
+ 
+ 
+@@ -1074,7 +1074,7 @@
+         )
+ 
+         self.mock_runner.run.assert_called_once_with(
+-            ["/usr/libexec/pacemaker/stonithd", "metadata"]
++            ["/usr/lib/pacemaker/stonithd", "metadata"]
+         )
+ 
+ 
+@@ -1415,7 +1415,7 @@
+                  }
+             ),
+             mock.call(
+-                ["/usr/libexec/pacemaker/stonithd", "metadata"]
++                ["/usr/lib/pacemaker/stonithd", "metadata"]
+             ),
+         ])
+ 
diff --git a/debian/patches/0010-Replace-chkconfig.patch b/debian/patches/0010-Replace-chkconfig.patch
index 58f53f0..53a2140 100644
--- a/debian/patches/0010-Replace-chkconfig.patch
+++ b/debian/patches/0010-Replace-chkconfig.patch
@@ -1,6 +1,13 @@
+Description: Replace chkconfig calls
+ All chkconfig calls should be replaced with update-rc.d
+ and insserv calls to work on Debian.
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Last-Update: 2016-11-13
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/pcsd/pcs.rb
 +++ b/pcsd/pcs.rb
-@@ -1956,11 +1956,22 @@
+@@ -1968,11 +1968,22 @@
  def is_service_enabled?(service)
    if ISSYSTEMCTL
      cmd = ['systemctl', 'is-enabled', "#{service}.service"]
@@ -8,7 +15,7 @@
 +    return (retcode == 0)
    else
 -    cmd = ['chkconfig', service]
-+    cmd = ['insserv', '-s']
++    cmd = ['/sbin/insserv', '-s']
 +    stdout, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
 +    if retcode != 0
 +      return nil
@@ -26,12 +33,12 @@
  end
  
  def is_service_running?(service)
-@@ -1975,12 +1986,13 @@
+@@ -1987,12 +1998,13 @@
  
  def is_service_installed?(service)
    unless ISSYSTEMCTL
 -    stdout, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), 'chkconfig')
-+    cmd = ['insserv', '-s']
++    cmd = ['/sbin/insserv', '-s']
 +    stdout, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
      if retcode != 0
        return nil
@@ -41,8 +48,8 @@
 +      if line.split(':')[3] == service
          return true
        end
-       return false
-@@ -2006,7 +2018,7 @@
+     }
+@@ -2019,7 +2031,7 @@
      cmd = ['systemctl', 'enable', "#{service}.service"]
    else
      # fails when the service is not installed
@@ -51,7 +58,7 @@
    end
    _, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
    return (retcode == 0)
-@@ -2021,7 +2033,7 @@
+@@ -2034,7 +2046,7 @@
    if ISSYSTEMCTL
      cmd = ['systemctl', 'disable', "#{service}.service"]
    else
@@ -60,63 +67,120 @@
    end
    _, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
    return (retcode == 0)
+--- a/pcs/lib/external.py
++++ b/pcs/lib/external.py
+@@ -145,7 +145,7 @@
+             _systemctl, "disable", _get_service_name(service, instance)
+         ])
+     else:
+-        stdout, stderr, retval = runner.run([_chkconfig, service, "off"])
++        stdout, stderr, retval = runner.run([_chkconfig, service, "disable"])
+     if retval != 0:
+         raise DisableServiceError(
+             service,
+@@ -169,7 +169,7 @@
+             _systemctl, "enable", _get_service_name(service, instance)
+         ])
+     else:
+-        stdout, stderr, retval = runner.run([_chkconfig, service, "on"])
++        stdout, stderr, retval = runner.run([_chkconfig, service, "enable"])
+     if retval != 0:
+         raise EnableServiceError(
+             service,
+@@ -252,10 +252,17 @@
+         dummy_stdout, dummy_stderr, retval = runner.run(
+             [_systemctl, "is-enabled", _get_service_name(service, instance)]
+         )
++        return retval == 0
+     else:
+-        dummy_stdout, dummy_stderr, retval = runner.run([_chkconfig, service])
+-
+-    return retval == 0
++        stdout, dummy_stderr, retval = runner.run(["/sbin/insserv", "-s"])
++        if retval != 0:
++            return False
++
++        for line in stdout.splitlines():
++            fields = line.split(":")
++            if fields[3] == service and fields[0] == "S":
++                return True
++        return False
+ 
+ 
+ def is_service_running(runner, service, instance=None):
+@@ -301,13 +308,13 @@
+     if is_systemctl():
+         return []
+ 
+-    stdout, dummy_stderr, return_code = runner.run([_chkconfig])
++    stdout, dummy_stderr, return_code = runner.run(["/sbin/insserv", "-s"])
+     if return_code != 0:
+         return []
+ 
+     service_list = []
+     for service in stdout.splitlines():
+-        service = service.split(" ", 1)[0]
++        service = service.split(":")[3]
+         if service:
+             service_list.append(service)
+     return service_list
 --- a/pcs/test/test_lib_external.py
 +++ b/pcs/test/test_lib_external.py
-@@ -1077,7 +1077,7 @@
+@@ -1082,7 +1082,7 @@
          self.mock_runner.run.return_value = ("", "", 0)
          lib.disable_service(self.mock_runner, self.service)
          self.mock_runner.run.assert_called_once_with(
--            ["chkconfig", self.service, "off"]
-+            ["update-rc.d", self.service, "disable"]
+-            [_chkconfig, self.service, "off"]
++            [_chkconfig, self.service, "disable"]
          )
  
      def test_not_systemctl_failed(self, mock_is_installed, mock_systemctl):
-@@ -1089,7 +1089,7 @@
+@@ -1094,7 +1094,7 @@
              lambda: lib.disable_service(self.mock_runner, self.service)
          )
          self.mock_runner.run.assert_called_once_with(
--            ["chkconfig", self.service, "off"]
-+            ["update-rc.d", self.service, "disable"]
+-            [_chkconfig, self.service, "off"]
++            [_chkconfig, self.service, "disable"]
          )
  
      def test_systemctl_not_installed(
-@@ -1125,7 +1125,7 @@
+@@ -1130,7 +1130,7 @@
          self.mock_runner.run.return_value = ("", "", 0)
          lib.disable_service(self.mock_runner, self.service, instance="test")
          self.mock_runner.run.assert_called_once_with(
--            ["chkconfig", self.service, "off"]
-+            ["update-rc.d", self.service, "disable"]
+-            [_chkconfig, self.service, "off"]
++            [_chkconfig, self.service, "disable"]
          )
  
  @mock.patch("pcs.lib.external.is_systemctl")
-@@ -1158,7 +1158,7 @@
+@@ -1163,7 +1163,7 @@
          self.mock_runner.run.return_value = ("", "", 0)
          lib.enable_service(self.mock_runner, self.service)
          self.mock_runner.run.assert_called_once_with(
--            ["chkconfig", self.service, "on"]
-+            ["update-rc.d", self.service, "enable"]
+-            [_chkconfig, self.service, "on"]
++            [_chkconfig, self.service, "enable"]
          )
  
      def test_not_systemctl_failed(self, mock_systemctl):
-@@ -1169,7 +1169,7 @@
+@@ -1174,7 +1174,7 @@
              lambda: lib.enable_service(self.mock_runner, self.service)
          )
          self.mock_runner.run.assert_called_once_with(
--            ["chkconfig", self.service, "on"]
-+            ["update-rc.d", self.service, "enable"]
+-            [_chkconfig, self.service, "on"]
++            [_chkconfig, self.service, "enable"]
          )
  
      def test_instance_systemctl(self, mock_systemctl):
-@@ -1187,7 +1187,7 @@
+@@ -1192,7 +1192,7 @@
          self.mock_runner.run.return_value = ("", "", 0)
          lib.enable_service(self.mock_runner, self.service, instance="test")
          self.mock_runner.run.assert_called_once_with(
--            ["chkconfig", self.service, "on"]
-+            ["update-rc.d", self.service, "enable"]
+-            [_chkconfig, self.service, "on"]
++            [_chkconfig, self.service, "enable"]
          )
  
  
-@@ -1396,18 +1396,18 @@
+@@ -1401,18 +1401,18 @@
  
      def test_not_systemctl_enabled(self, mock_systemctl):
          mock_systemctl.return_value = False
@@ -124,8 +188,8 @@
 +        self.mock_runner.run.return_value = ("S:02:2 3 4 5:" + self.service, "", 0)
          self.assertTrue(lib.is_service_enabled(self.mock_runner, self.service))
          self.mock_runner.run.assert_called_once_with(
--            ["chkconfig", self.service]
-+            ["insserv", "-s"]
+-            [_chkconfig, self.service]
++            ["/sbin/insserv", "-s"]
          )
  
      def test_not_systemctl_disabled(self, mock_systemctl):
@@ -134,12 +198,12 @@
 +        self.mock_runner.run.return_value = ("K:01:0 1 6:" + self.service, "", 0)
          self.assertFalse(lib.is_service_enabled(self.mock_runner, self.service))
          self.mock_runner.run.assert_called_once_with(
--            ["chkconfig", self.service]
-+            ["insserv", "-s"]
+-            [_chkconfig, self.service]
++            ["/sbin/insserv", "-s"]
          )
  
  
-@@ -1550,23 +1550,23 @@
+@@ -1555,23 +1555,23 @@
      def test_success(self, mock_is_systemctl):
          mock_is_systemctl.return_value = False
          self.mock_runner.run.return_value = ("""\
@@ -155,73 +219,23 @@
              ["pcsd", "sbd", "pacemaker"]
          )
          self.assertEqual(mock_is_systemctl.call_count, 1)
--        self.mock_runner.run.assert_called_once_with(["chkconfig"])
-+        self.mock_runner.run.assert_called_once_with(["insserv", "-s"])
+-        self.mock_runner.run.assert_called_once_with([_chkconfig])
++        self.mock_runner.run.assert_called_once_with(["/sbin/insserv", "-s"])
  
      def test_failed(self, mock_is_systemctl):
          mock_is_systemctl.return_value = False
          self.mock_runner.run.return_value = ("stdout", "failed", 1)
          self.assertEqual(lib.get_non_systemd_services(self.mock_runner), [])
          self.assertEqual(mock_is_systemctl.call_count, 1)
--        self.mock_runner.run.assert_called_once_with(["chkconfig"])
-+        self.mock_runner.run.assert_called_once_with(["insserv", "-s"])
+-        self.mock_runner.run.assert_called_once_with([_chkconfig])
++        self.mock_runner.run.assert_called_once_with(["/sbin/insserv", "-s"])
  
      def test_systemd(self, mock_is_systemctl):
          mock_is_systemctl.return_value = True
---- a/pcs/lib/external.py
-+++ b/pcs/lib/external.py
-@@ -143,7 +143,7 @@
-             "systemctl", "disable", _get_service_name(service, instance)
-         ])
-     else:
--        stdout, stderr, retval = runner.run(["chkconfig", service, "off"])
-+        stdout, stderr, retval = runner.run(["update-rc.d", service, "disable"])
-     if retval != 0:
-         raise DisableServiceError(
-             service,
-@@ -167,7 +167,7 @@
-             "systemctl", "enable", _get_service_name(service, instance)
-         ])
-     else:
--        stdout, stderr, retval = runner.run(["chkconfig", service, "on"])
-+        stdout, stderr, retval = runner.run(["update-rc.d", service, "enable"])
-     if retval != 0:
-         raise EnableServiceError(
-             service,
-@@ -250,10 +250,17 @@
-         dummy_stdout, dummy_stderr, retval = runner.run(
-             ["systemctl", "is-enabled", _get_service_name(service, instance)]
-         )
-+        return retval == 0
-     else:
--        dummy_stdout, dummy_stderr, retval = runner.run(["chkconfig", service])
--
--    return retval == 0
-+        stdout, dummy_stderr, retval = runner.run(["insserv", "-s"])
-+        if retval != 0:
-+            return False
-+
-+        for line in stdout.splitlines():
-+            fields = line.split(":")
-+            if fields[3] == service and fields[0] == "S":
-+                return True
-+        return False
- 
- 
- def is_service_running(runner, service, instance=None):
-@@ -299,13 +306,13 @@
-     if is_systemctl():
-         return []
- 
--    stdout, dummy_stderr, return_code = runner.run(["chkconfig"])
-+    stdout, dummy_stderr, return_code = runner.run(["insserv", "-s"])
-     if return_code != 0:
-         return []
- 
-     service_list = []
-     for service in stdout.splitlines():
--        service = service.split(" ", 1)[0]
-+        service = service.split(":")[3]
-         if service:
-             service_list.append(service)
-     return service_list
+--- a/pcs/settings.py.debian
++++ b/pcs/settings.py.debian
+@@ -6,3 +6,4 @@
+ stonithd_binary = "/usr/lib/pacemaker/stonithd"
+ pcsd_exec_location = "/usr/share/pcsd/"
+ sbd_config = "/etc/default/sbd"
++chkconfig_binary = "/usr/sbin/update-rc.d"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/pcs.git



More information about the Debian-HA-Commits mailing list