[Debian-ha-commits] [pcs] 04/05: d/rules: remove SNMP until python-pyagentx is available
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Mon Nov 27 11:04:12 UTC 2017
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch master
in repository pcs.
commit 663cb9331caacfe2f51c8a98bfd86a300f5cb98c
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Mon Nov 27 11:07:31 2017 +0100
d/rules: remove SNMP until python-pyagentx is available
---
Makefile | 1 +
debian/patches/0010-Fix-SNMP-install.patch | 16 +++++++++
debian/patches/series | 1 +
debian/pcs.install | 15 +++++----
debian/rules | 11 ++++++
pcs/cluster.py | 2 +-
pcs/lib/external.py | 21 ++++++++----
pcs/lib/test/test_resource_agent.py | 8 ++---
pcs/pcs | 2 +-
pcs/settings.py.debian | 10 +++---
pcs/test/test_cluster.py | 52 ++++++++++++++---------------
pcs/test/test_lib_corosync_config_parser.py | 8 ++---
pcs/test/test_lib_external.py | 31 +++++++++--------
pcs/test/test_resource.py | 8 ++---
pcs/test/test_stonith.py | 8 ++---
pcsd/Gemfile | 2 +-
pcsd/Gemfile.lock | 48 --------------------------
pcsd/config.rb | 12 +++----
pcsd/pcs.rb | 26 +++++++++++----
pcsd/pcsd-cli.rb | 4 +--
pcsd/permissions.rb | 4 +--
pcsd/settings.rb.debian | 4 +--
pcsd/ssl.rb | 1 -
pcsd/test/.gitignore | 1 -
24 files changed, 148 insertions(+), 148 deletions(-)
diff --git a/Makefile b/Makefile
index 04cd62a..68f1726 100644
--- a/Makefile
+++ b/Makefile
@@ -124,6 +124,7 @@ install: install_bundled_libs
install -D -m644 pcs/bash_completion ${BASH_COMPLETION_DIR}/pcs
install -m644 -D pcs/pcs.8 ${DESTDIR}/${MANDIR}/man8/pcs.8
# pcs SNMP install
+ mkdir -p ${PCS_PARENT_DIR}
mv ${DESTDIR}${PREFIX}/bin/pcs_snmp_agent ${PCS_PARENT_DIR}/pcs_snmp_agent
install -d ${DESTDIR}/var/log/pcs
install -d ${SNMP_MIB_DIR_FULL}
diff --git a/debian/patches/0010-Fix-SNMP-install.patch b/debian/patches/0010-Fix-SNMP-install.patch
new file mode 100644
index 0000000..fd3b610
--- /dev/null
+++ b/debian/patches/0010-Fix-SNMP-install.patch
@@ -0,0 +1,16 @@
+Description: Fixes for SNMP instalation
+ Make sure SNMP installs cleanly for now
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Last-Update: 2017-11-27
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Makefile
++++ b/Makefile
+@@ -124,6 +124,7 @@
+ install -D -m644 pcs/bash_completion ${BASH_COMPLETION_DIR}/pcs
+ install -m644 -D pcs/pcs.8 ${DESTDIR}/${MANDIR}/man8/pcs.8
+ # pcs SNMP install
++ mkdir -p ${PCS_PARENT_DIR}
+ mv ${DESTDIR}${PREFIX}/bin/pcs_snmp_agent ${PCS_PARENT_DIR}/pcs_snmp_agent
+ install -d ${DESTDIR}/var/log/pcs
+ install -d ${SNMP_MIB_DIR_FULL}
diff --git a/debian/patches/series b/debian/patches/series
index 033c6fc..0fd88ad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
0007-Fix-testsuite.patch
0008-Replace-chkconfig.patch
0009-Fix-python3-build.patch
+0010-Fix-SNMP-install.patch
diff --git a/debian/pcs.install b/debian/pcs.install
index e1d60ce..05f1365 100644
--- a/debian/pcs.install
+++ b/debian/pcs.install
@@ -1,11 +1,12 @@
etc/bash_completion.d/* usr/share/bash-completion/completions/
-etc/default/*
-etc/init.d/*
-etc/logrotate.d/*
-etc/pam.d/*
-lib/systemd/system/*
-usr/sbin/*
-usr/share/*
+etc/default/pcsd
+etc/init.d/pcsd
+etc/logrotate.d/pcsd
+etc/pam.d/pcsd
+lib/systemd/system/pcsd.service
+usr/sbin/pcs
+usr/share/man/man8/pcs.8
+usr/share/man/man8/pcsd.8
README.md usr/share/doc/pcs
usr/share/pcsd/*
usr/lib/python*/*-packages/pcs/*
diff --git a/debian/rules b/debian/rules
index 5c4c5ec..45b056f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,6 +25,9 @@ override_dh_auto_install:
PREFIX=/usr \
DESTDIR=$(CURDIR)/debian/tmp \
PYTHON_SITELIB=/usr/lib/python3/dist-packages \
+ PYAGENTX_INSTALLED=true \
+ systemddir=/lib/systemd \
+ SYSTEMCTL_OVERRIDE=true \
install_settings=true
# Make pcsd
@@ -47,6 +50,14 @@ override_dh_auto_install:
ln -sf /usr/share/fonts/truetype/liberation/$$ttf $$ttf; \
done
+ # Remove SNMP until python-pyagentx is available
+ rm $(CURDIR)/debian/tmp/etc/logrotate.d/pcs_snmp_agent
+ rm $(CURDIR)/debian/tmp/etc/sysconfig/pcs_snmp_agent
+ rm $(CURDIR)/debian/tmp/lib/systemd/system/pcs_snmp_agent.service
+ rm $(CURDIR)/debian/tmp/usr/lib/pcs/pcs_snmp_agent
+ rm $(CURDIR)/debian/tmp/usr/share/snmp/mibs/*
+ rm $(CURDIR)/debian/tmp/usr/share/man/man8/pcs_snmp_agent.8
+
override_dh_python3:
dh_python3 -p pcs --skip-private
dh_python3 -p pcs /usr/share/pcsd
diff --git a/pcs/cluster.py b/pcs/cluster.py
index a330164..43e0138 100644
--- a/pcs/cluster.py
+++ b/pcs/cluster.py
@@ -888,7 +888,7 @@ def cluster_setup_create_corosync_conf(
quorum_section.add_attribute("two_node", "1")
logging_section.add_attribute("to_logfile", "yes")
- logging_section.add_attribute("logfile", "/var/log/cluster/corosync.log")
+ logging_section.add_attribute("logfile", "/var/log/corosync/corosync.log")
logging_section.add_attribute("to_syslog", "yes")
return str(corosync_conf), messages
diff --git a/pcs/lib/external.py b/pcs/lib/external.py
index 4ef5d6b..013af4f 100644
--- a/pcs/lib/external.py
+++ b/pcs/lib/external.py
@@ -121,7 +121,7 @@ def disable_service(runner, service, instance=None):
_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,
@@ -145,7 +145,7 @@ def enable_service(runner, service, instance=None):
_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,
@@ -228,10 +228,17 @@ def is_service_enabled(runner, service, instance=None):
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):
@@ -278,13 +285,13 @@ def get_non_systemd_services(runner):
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
diff --git a/pcs/lib/test/test_resource_agent.py b/pcs/lib/test/test_resource_agent.py
index a8be5fc..10f3327 100644
--- a/pcs/lib/test/test_resource_agent.py
+++ b/pcs/lib/test/test_resource_agent.py
@@ -1483,7 +1483,7 @@ class StonithdMetadataGetMetadataTest(TestCase, ExtendedAssertionsMixin):
)
self.mock_runner.run.assert_called_once_with(
- ["/usr/libexec/pacemaker/stonithd", "metadata"]
+ ["/usr/lib/pacemaker/stonithd", "metadata"]
)
def test_failed_to_get_xml(self):
@@ -1499,7 +1499,7 @@ class StonithdMetadataGetMetadataTest(TestCase, ExtendedAssertionsMixin):
)
self.mock_runner.run.assert_called_once_with(
- ["/usr/libexec/pacemaker/stonithd", "metadata"]
+ ["/usr/lib/pacemaker/stonithd", "metadata"]
)
def test_invalid_xml(self):
@@ -1515,7 +1515,7 @@ class StonithdMetadataGetMetadataTest(TestCase, ExtendedAssertionsMixin):
)
self.mock_runner.run.assert_called_once_with(
- ["/usr/libexec/pacemaker/stonithd", "metadata"]
+ ["/usr/lib/pacemaker/stonithd", "metadata"]
)
@@ -1866,7 +1866,7 @@ class StonithAgentMetadataGetParametersTest(TestCase):
}
),
mock.call(
- ["/usr/libexec/pacemaker/stonithd", "metadata"]
+ ["/usr/lib/pacemaker/stonithd", "metadata"]
),
])
diff --git a/pcs/pcs b/pcs/pcs
index 736f9cd..3dff69a 100755
--- a/pcs/pcs
+++ b/pcs/pcs
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import absolute_import
import os.path
diff --git a/pcs/settings.py.debian b/pcs/settings.py.debian
index 90ef51d..fd07090 100644
--- a/pcs/settings.py.debian
+++ b/pcs/settings.py.debian
@@ -1,7 +1,9 @@
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"
+chkconfig_binary = "/usr/sbin/update-rc.d"
diff --git a/pcs/test/test_cluster.py b/pcs/test/test_cluster.py
index 01998f0..ce733dc 100644
--- a/pcs/test/test_cluster.py
+++ b/pcs/test/test_cluster.py
@@ -258,7 +258,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
"""
@@ -317,7 +317,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -460,7 +460,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -505,7 +505,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -569,7 +569,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -614,7 +614,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -655,7 +655,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -701,7 +701,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -743,7 +743,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -778,7 +778,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -826,7 +826,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -872,7 +872,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -913,7 +913,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -963,7 +963,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1009,7 +1009,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1411,7 +1411,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1533,7 +1533,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1592,7 +1592,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1651,7 +1651,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1712,7 +1712,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1778,7 +1778,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1843,7 +1843,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1908,7 +1908,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -1997,7 +1997,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -2585,7 +2585,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
@@ -2823,7 +2823,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
}
""")
diff --git a/pcs/test/test_lib_corosync_config_parser.py b/pcs/test/test_lib_corosync_config_parser.py
index 803d458..094049f 100644
--- a/pcs/test/test_lib_corosync_config_parser.py
+++ b/pcs/test/test_lib_corosync_config_parser.py
@@ -1019,7 +1019,7 @@ logging {
# Log to a log file. When set to "no", the "logfile" option
# must not be set.
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
# Log to the system log daemon. When in doubt, set to yes.
to_syslog: yes
# Log debug messages (very verbose). When in doubt, leave off.
@@ -1059,7 +1059,7 @@ logging {
fileline: off
to_stderr: no
to_logfile: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
to_syslog: yes
debug: off
timestamp: on
@@ -1096,7 +1096,7 @@ logging {
fileline: off
to_logfile: yes
to_syslog: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
debug: off
timestamp: on
logger_subsys {
@@ -1154,7 +1154,7 @@ logging {
fileline: off
to_logfile: yes
to_syslog: yes
- logfile: /var/log/cluster/corosync.log
+ logfile: /var/log/corosync/corosync.log
debug: off
timestamp: on
diff --git a/pcs/test/test_lib_external.py b/pcs/test/test_lib_external.py
index b249c47..b6fa37e 100644
--- a/pcs/test/test_lib_external.py
+++ b/pcs/test/test_lib_external.py
@@ -1194,7 +1194,7 @@ class DisableServiceTest(TestCase):
self.mock_runner, self.service, None
)
self.mock_runner.run.assert_called_once_with(
- [_chkconfig, self.service, "off"]
+ [_chkconfig, self.service, "disable"]
)
def test_not_systemctl_failed(self, mock_is_installed, mock_systemctl):
@@ -1209,7 +1209,7 @@ class DisableServiceTest(TestCase):
self.mock_runner, self.service, None
)
self.mock_runner.run.assert_called_once_with(
- [_chkconfig, self.service, "off"]
+ [_chkconfig, self.service, "disable"]
)
def test_systemctl_not_installed(
@@ -1259,7 +1259,7 @@ class DisableServiceTest(TestCase):
self.mock_runner, self.service, instance
)
self.mock_runner.run.assert_called_once_with(
- [_chkconfig, self.service, "off"]
+ [_chkconfig, self.service, "disable"]
)
@mock.patch("pcs.lib.external.is_systemctl")
@@ -1292,7 +1292,7 @@ class EnableServiceTest(TestCase):
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"]
+ [_chkconfig, self.service, "enable"]
)
def test_not_systemctl_failed(self, mock_systemctl):
@@ -1303,7 +1303,7 @@ class EnableServiceTest(TestCase):
lambda: lib.enable_service(self.mock_runner, self.service)
)
self.mock_runner.run.assert_called_once_with(
- [_chkconfig, self.service, "on"]
+ [_chkconfig, self.service, "enable"]
)
def test_instance_systemctl(self, mock_systemctl):
@@ -1321,7 +1321,7 @@ class EnableServiceTest(TestCase):
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"]
+ [_chkconfig, self.service, "enable"]
)
@@ -1530,18 +1530,18 @@ class IsServiceEnabledTest(TestCase):
def test_not_systemctl_enabled(self, mock_systemctl):
mock_systemctl.return_value = False
- self.mock_runner.run.return_value = ("", "", 0)
+ 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]
+ ["/sbin/insserv", "-s"]
)
def test_not_systemctl_disabled(self, mock_systemctl):
mock_systemctl.return_value = False
- self.mock_runner.run.return_value = ("", "", 3)
+ 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]
+ ["/sbin/insserv", "-s"]
)
@@ -1726,24 +1726,23 @@ class GetNonSystemdServicesTest(TestCase):
mock_is_systemctl.return_value = False
self.mock_runner.run.return_value = (outdent(
"""\
- pcsd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
- sbd 0:off 1:on 2:on 3:on 4:on 5:on 6:off
- pacemaker 0:off 1:off 2:off 3:off 4:off 5:off 6:off
- """
+ K:01:0 1 6:pcsd
+ S:02:2 3 4 5:sbd
+ S:02:2 3 4 5:pacemaker"""
), "", 0)
self.assertEqual(
lib.get_non_systemd_services(self.mock_runner),
["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(["/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(["/sbin/insserv", "-s"])
def test_systemd(self, mock_is_systemctl):
mock_is_systemctl.return_value = True
diff --git a/pcs/test/test_resource.py b/pcs/test/test_resource.py
index bd596f6..2724b74 100644
--- a/pcs/test/test_resource.py
+++ b/pcs/test/test_resource.py
@@ -2537,13 +2537,13 @@ Ticket Constraints:
def testLSBResource(self):
self.assert_pcs_fail(
- "resource create --no-default-ops D2 lsb:network foo=bar",
+ "resource create --no-default-ops D2 lsb:networking foo=bar",
"Error: invalid resource option 'foo', there are no options"
" allowed, use --force to override\n"
)
self.assert_pcs_success(
- "resource create --no-default-ops D2 lsb:network foo=bar --force",
+ "resource create --no-default-ops D2 lsb:networking foo=bar --force",
"Warning: invalid resource option 'foo', there are no options"
" allowed\n"
)
@@ -2552,7 +2552,7 @@ Ticket Constraints:
"resource show --full",
outdent(
"""\
- Resource: D2 (class=lsb type=network)
+ Resource: D2 (class=lsb type=networking)
Attributes: foo=bar
Operations: monitor interval=15 timeout=15 (D2-monitor-interval-15)
"""
@@ -2575,7 +2575,7 @@ Ticket Constraints:
"resource show --full",
outdent(
"""\
- Resource: D2 (class=lsb type=network)
+ Resource: D2 (class=lsb type=networking)
Attributes: foo=bar bar=baz
Operations: monitor interval=15 timeout=15 (D2-monitor-interval-15)
"""
diff --git a/pcs/test/test_stonith.py b/pcs/test/test_stonith.py
index becc1a1..baeac4a 100644
--- a/pcs/test/test_stonith.py
+++ b/pcs/test/test_stonith.py
@@ -298,7 +298,7 @@ class StonithTest(TestCase, AssertPcsMixin):
output, returnVal = pcs(
temp_cib,
- "stonith create f4 fence_xvm meta provides=something"
+ "stonith create f4 fence_dummy meta provides=something"
)
ac(output, "")
self.assertEqual(0, returnVal)
@@ -314,7 +314,7 @@ class StonithTest(TestCase, AssertPcsMixin):
Resource: f3 (class=stonith type=fence_scsi)
Meta Attrs: provides=unfencing
Operations: monitor interval=60s (f3-monitor-interval-60s)
- Resource: f4 (class=stonith type=fence_xvm)
+ Resource: f4 (class=stonith type=fence_dummy)
Meta Attrs: provides=something
Operations: monitor interval=60s (f4-monitor-interval-60s)
""")
@@ -347,7 +347,7 @@ class StonithTest(TestCase, AssertPcsMixin):
output, returnVal = pcs(
temp_cib,
- "stonith create f4 fence_xvm meta provides=something"
+ "stonith create f4 fence_dummy meta provides=something"
)
ac(output, "")
self.assertEqual(0, returnVal)
@@ -366,7 +366,7 @@ class StonithTest(TestCase, AssertPcsMixin):
Attributes: key=abc
Meta Attrs: provides=unfencing
Operations: monitor interval=60s (f3-monitor-interval-60s)
- Resource: f4 (class=stonith type=fence_xvm)
+ Resource: f4 (class=stonith type=fence_dummy)
Meta Attrs: provides=something
Operations: monitor interval=60s (f4-monitor-interval-60s)
""")
diff --git a/pcsd/Gemfile b/pcsd/Gemfile
index e01b31c..cab24cb 100644
--- a/pcsd/Gemfile
+++ b/pcsd/Gemfile
@@ -15,6 +15,6 @@ gem 'rpam-ruby19', :platform => [:ruby_19, :ruby_20, :ruby_21, :ruby_22]
gem 'json'
gem 'multi_json'
gem 'open4'
-gem 'orderedhash'
+gem 'activesupport'
gem 'ffi'
gem 'ethon'
diff --git a/pcsd/Gemfile.lock b/pcsd/Gemfile.lock
deleted file mode 100644
index dcb0d05..0000000
--- a/pcsd/Gemfile.lock
+++ /dev/null
@@ -1,48 +0,0 @@
-GEM
- remote: https://rubygems.org/
- remote: https://tojeline.fedorapeople.org/rubygems/
- specs:
- backports (3.9.1)
- ethon (0.10.1)
- ffi (1.9.18)
- json (2.1.0)
- multi_json (1.12.2)
- open4 (1.3.4)
- orderedhash (0.0.6)
- rack (1.6.4)
- rack-protection (1.5.3)
- rack
- rack-test (0.7.0)
- rack (>= 1.0)
- rpam-ruby19 (1.2.1)
- sinatra (1.4.8)
- rack (~> 1.4)
- rack-protection (~> 1.4)
- tilt (>= 1.3, < 3)
- sinatra-contrib (1.4.7)
- backports (>= 2.0)
- multi_json
- rack-protection
- rack-test
- sinatra (~> 1.4.0)
- tilt (>= 1.3, < 3)
- tilt (2.0.8)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- backports
- ethon
- ffi
- json
- multi_json
- open4
- orderedhash
- rack
- rack-protection
- rack-test
- rpam-ruby19
- sinatra
- sinatra-contrib
- tilt
diff --git a/pcsd/config.rb b/pcsd/config.rb
index 23738a3..6a66d93 100644
--- a/pcsd/config.rb
+++ b/pcsd/config.rb
@@ -1,5 +1,5 @@
require 'json'
-require 'orderedhash'
+require 'active_support/ordered_hash'
require 'cluster.rb'
require 'permissions.rb'
@@ -124,15 +124,15 @@ class PCSConfig
end
def text()
- out_hash = OrderedHash.new
+ out_hash = ActiveSupport::OrderedHash.new
out_hash['format_version'] = CURRENT_FORMAT
out_hash['data_version'] = @data_version
out_hash['clusters'] = []
- out_hash['permissions'] = OrderedHash.new
+ out_hash['permissions'] = ActiveSupport::OrderedHash.new
out_hash['permissions']['local_cluster'] = []
@clusters.each { |c|
- c_hash = OrderedHash.new
+ c_hash = ActiveSupport::OrderedHash.new
c_hash['name'] = c.name
c_hash['nodes'] = c.nodes.uniq.sort
out_hash['clusters'] << c_hash
@@ -182,7 +182,7 @@ class PCSConfig
end
def hash_to_ordered_hash(hash)
- new_hash = OrderedHash.new
+ new_hash = ActiveSupport::OrderedHash.new
hash.keys.sort.each { |key| new_hash[key] = hash[key] }
return new_hash
end
@@ -235,7 +235,7 @@ class PCSTokens
end
def text()
- out_hash = OrderedHash.new
+ out_hash = ActiveSupport::OrderedHash.new
out_hash['format_version'] = CURRENT_FORMAT
out_hash['data_version'] = @data_version
out_hash['tokens'] = hash_to_ordered_hash(@tokens)
diff --git a/pcsd/pcs.rb b/pcsd/pcs.rb
index 68d2e7e..038a1c9 100644
--- a/pcsd/pcs.rb
+++ b/pcsd/pcs.rb
@@ -2111,11 +2111,22 @@ end
def is_service_enabled?(service)
if ISSYSTEMCTL
cmd = ['systemctl', 'is-enabled', "#{service}.service"]
+ _, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
+ return (retcode == 0)
else
- cmd = ['chkconfig', service]
+ cmd = ['/sbin/insserv', '-s']
+ stdout, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
+ if retcode != 0
+ return nil
+ end
+ stdout.each { |line|
+ parts = line.split(':')
+ if parts[3] == service and parts[0] == 'S'
+ return true
+ end
+ }
+ return false
end
- _, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
- return (retcode == 0)
end
def is_service_running?(service)
@@ -2130,12 +2141,13 @@ end
def is_service_installed?(service)
unless ISSYSTEMCTL
- stdout, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), 'chkconfig')
+ cmd = ['/sbin/insserv', '-s']
+ stdout, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
if retcode != 0
return nil
end
stdout.each { |line|
- if line.split(' ')[0] == service
+ if line.split(':')[3] == service
return true
end
}
@@ -2165,7 +2177,7 @@ def enable_service(service)
cmd = ['systemctl', 'enable', "#{service}.service"]
else
# fails when the service is not installed
- cmd = ['chkconfig', service, 'on']
+ cmd = ['update-rc.d', service, 'enable']
end
_, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
return (retcode == 0)
@@ -2180,7 +2192,7 @@ def disable_service(service)
if ISSYSTEMCTL
cmd = ['systemctl', 'disable', "#{service}.service"]
else
- cmd = ['chkconfig', service, 'off']
+ cmd = ['update-rc.d', service, 'disable']
end
_, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
return (retcode == 0)
diff --git a/pcsd/pcsd-cli.rb b/pcsd/pcsd-cli.rb
index 3c1d078..fcc818b 100755
--- a/pcsd/pcsd-cli.rb
+++ b/pcsd/pcsd-cli.rb
@@ -4,7 +4,7 @@ require 'rubygems'
require 'etc'
require 'json'
require 'stringio'
-require 'orderedhash'
+require 'active_support/ordered_hash'
require 'bootstrap.rb'
require 'pcs.rb'
@@ -12,7 +12,7 @@ require 'auth.rb'
require 'remote.rb'
def cli_format_response(status, text=nil, data=nil)
- response = OrderedHash.new
+ response = ActiveSupport::OrderedHash.new
response['status'] = status
response['text'] = text if text
response['data'] = data if data
diff --git a/pcsd/permissions.rb b/pcsd/permissions.rb
index 7601865..9816dde 100644
--- a/pcsd/permissions.rb
+++ b/pcsd/permissions.rb
@@ -1,4 +1,4 @@
-require 'orderedhash'
+require 'active_support/ordered_hash'
module Permissions
@@ -104,7 +104,7 @@ module Permissions
end
def to_hash()
- perm_hash = OrderedHash.new
+ perm_hash = ActiveSupport::OrderedHash.new
perm_hash['type'] = @type
perm_hash['name'] = @name
perm_hash['allow'] = @allow_list.uniq.sort
diff --git a/pcsd/settings.rb.debian b/pcsd/settings.rb.debian
index 61d03ac..db07f4b 100644
--- a/pcsd/settings.rb.debian
+++ b/pcsd/settings.rb.debian
@@ -7,8 +7,8 @@ CRT_FILE = PCSD_VAR_LOCATION + 'pcsd.crt'
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"
+CIB_BINARY = '/usr/lib/pacemaker/cib'
CRM_MON = "/usr/sbin/crm_mon"
CRM_NODE = "/usr/sbin/crm_node"
CRM_ATTRIBUTE = "/usr/sbin/crm_attribute"
diff --git a/pcsd/ssl.rb b/pcsd/ssl.rb
index eaf2cbf..b17f87c 100644
--- a/pcsd/ssl.rb
+++ b/pcsd/ssl.rb
@@ -1,4 +1,3 @@
-require 'rubygems'
require 'webrick'
require 'webrick/https'
require 'openssl'
diff --git a/pcsd/test/.gitignore b/pcsd/test/.gitignore
deleted file mode 100644
index 1944fd6..0000000
--- a/pcsd/test/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.tmp
--
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