[Debian-ha-commits] [pcs] 01/01: d/patches: revert changes from git
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Mon Nov 27 11:27:15 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 fe3ec33cd2333d73b89a68d4a22b548b07509148
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Mon Nov 27 12:15:52 2017 +0100
d/patches: revert changes from git
---
Makefile | 1 -
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 +
20 files changed, 141 insertions(+), 112 deletions(-)
diff --git a/Makefile b/Makefile
index 68f1726..04cd62a 100644
--- a/Makefile
+++ b/Makefile
@@ -124,7 +124,6 @@ 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/pcs/cluster.py b/pcs/cluster.py
index 43e0138..a330164 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/corosync/corosync.log")
+ logging_section.add_attribute("logfile", "/var/log/cluster/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 013af4f..4ef5d6b 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, "disable"])
+ stdout, stderr, retval = runner.run([_chkconfig, service, "off"])
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, "enable"])
+ stdout, stderr, retval = runner.run([_chkconfig, service, "on"])
if retval != 0:
raise EnableServiceError(
service,
@@ -228,17 +228,10 @@ 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:
- 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
+ dummy_stdout, dummy_stderr, retval = runner.run([_chkconfig, service])
+
+ return retval == 0
def is_service_running(runner, service, instance=None):
@@ -285,13 +278,13 @@ def get_non_systemd_services(runner):
if is_systemctl():
return []
- stdout, dummy_stderr, return_code = runner.run(["/sbin/insserv", "-s"])
+ stdout, dummy_stderr, return_code = runner.run([_chkconfig])
if return_code != 0:
return []
service_list = []
for service in stdout.splitlines():
- service = service.split(":")[3]
+ service = service.split(" ", 1)[0]
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 10f3327..a8be5fc 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/lib/pacemaker/stonithd", "metadata"]
+ ["/usr/libexec/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/lib/pacemaker/stonithd", "metadata"]
+ ["/usr/libexec/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/lib/pacemaker/stonithd", "metadata"]
+ ["/usr/libexec/pacemaker/stonithd", "metadata"]
)
@@ -1866,7 +1866,7 @@ class StonithAgentMetadataGetParametersTest(TestCase):
}
),
mock.call(
- ["/usr/lib/pacemaker/stonithd", "metadata"]
+ ["/usr/libexec/pacemaker/stonithd", "metadata"]
),
])
diff --git a/pcs/pcs b/pcs/pcs
index 3dff69a..736f9cd 100755
--- a/pcs/pcs
+++ b/pcs/pcs
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
from __future__ import absolute_import
import os.path
diff --git a/pcs/settings.py.debian b/pcs/settings.py.debian
index fd07090..90ef51d 100644
--- a/pcs/settings.py.debian
+++ b/pcs/settings.py.debian
@@ -1,9 +1,7 @@
from pcs.settings_default import *
-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"
+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"
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 ce733dc..01998f0 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/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
"""
@@ -317,7 +317,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -460,7 +460,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -505,7 +505,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -569,7 +569,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -614,7 +614,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -655,7 +655,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -701,7 +701,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -743,7 +743,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -778,7 +778,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -826,7 +826,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -872,7 +872,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -913,7 +913,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -963,7 +963,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1009,7 +1009,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1411,7 +1411,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1533,7 +1533,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1592,7 +1592,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1651,7 +1651,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1712,7 +1712,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1778,7 +1778,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1843,7 +1843,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1908,7 +1908,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -1997,7 +1997,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -2585,7 +2585,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
""")
@@ -2823,7 +2823,7 @@ quorum {
logging {
to_logfile: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/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 094049f..803d458 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/corosync/corosync.log
+ logfile: /var/log/cluster/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/corosync/corosync.log
+ logfile: /var/log/cluster/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/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
@@ -1154,7 +1154,7 @@ logging {
fileline: off
to_logfile: yes
to_syslog: yes
- logfile: /var/log/corosync/corosync.log
+ logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
diff --git a/pcs/test/test_lib_external.py b/pcs/test/test_lib_external.py
index b6fa37e..b249c47 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, "disable"]
+ [_chkconfig, self.service, "off"]
)
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, "disable"]
+ [_chkconfig, self.service, "off"]
)
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, "disable"]
+ [_chkconfig, self.service, "off"]
)
@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, "enable"]
+ [_chkconfig, self.service, "on"]
)
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, "enable"]
+ [_chkconfig, self.service, "on"]
)
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, "enable"]
+ [_chkconfig, self.service, "on"]
)
@@ -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 = ("S:02:2 3 4 5:" + self.service, "", 0)
+ self.mock_runner.run.return_value = ("", "", 0)
self.assertTrue(lib.is_service_enabled(self.mock_runner, self.service))
self.mock_runner.run.assert_called_once_with(
- ["/sbin/insserv", "-s"]
+ [_chkconfig, self.service]
)
def test_not_systemctl_disabled(self, mock_systemctl):
mock_systemctl.return_value = False
- self.mock_runner.run.return_value = ("K:01:0 1 6:" + self.service, "", 0)
+ self.mock_runner.run.return_value = ("", "", 3)
self.assertFalse(lib.is_service_enabled(self.mock_runner, self.service))
self.mock_runner.run.assert_called_once_with(
- ["/sbin/insserv", "-s"]
+ [_chkconfig, self.service]
)
@@ -1726,23 +1726,24 @@ class GetNonSystemdServicesTest(TestCase):
mock_is_systemctl.return_value = False
self.mock_runner.run.return_value = (outdent(
"""\
- K:01:0 1 6:pcsd
- S:02:2 3 4 5:sbd
- S:02:2 3 4 5:pacemaker"""
+ 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
+ """
), "", 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(["/sbin/insserv", "-s"])
+ self.mock_runner.run.assert_called_once_with([_chkconfig])
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(["/sbin/insserv", "-s"])
+ self.mock_runner.run.assert_called_once_with([_chkconfig])
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 2724b74..bd596f6 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:networking foo=bar",
+ "resource create --no-default-ops D2 lsb:network 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:networking foo=bar --force",
+ "resource create --no-default-ops D2 lsb:network 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=networking)
+ Resource: D2 (class=lsb type=network)
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=networking)
+ Resource: D2 (class=lsb type=network)
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 baeac4a..becc1a1 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_dummy meta provides=something"
+ "stonith create f4 fence_xvm 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_dummy)
+ Resource: f4 (class=stonith type=fence_xvm)
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_dummy meta provides=something"
+ "stonith create f4 fence_xvm 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_dummy)
+ Resource: f4 (class=stonith type=fence_xvm)
Meta Attrs: provides=something
Operations: monitor interval=60s (f4-monitor-interval-60s)
""")
diff --git a/pcsd/Gemfile b/pcsd/Gemfile
index cab24cb..e01b31c 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 'activesupport'
+gem 'orderedhash'
gem 'ffi'
gem 'ethon'
diff --git a/pcsd/Gemfile.lock b/pcsd/Gemfile.lock
new file mode 100644
index 0000000..dcb0d05
--- /dev/null
+++ b/pcsd/Gemfile.lock
@@ -0,0 +1,48 @@
+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 6a66d93..23738a3 100644
--- a/pcsd/config.rb
+++ b/pcsd/config.rb
@@ -1,5 +1,5 @@
require 'json'
-require 'active_support/ordered_hash'
+require 'orderedhash'
require 'cluster.rb'
require 'permissions.rb'
@@ -124,15 +124,15 @@ class PCSConfig
end
def text()
- out_hash = ActiveSupport::OrderedHash.new
+ out_hash = OrderedHash.new
out_hash['format_version'] = CURRENT_FORMAT
out_hash['data_version'] = @data_version
out_hash['clusters'] = []
- out_hash['permissions'] = ActiveSupport::OrderedHash.new
+ out_hash['permissions'] = OrderedHash.new
out_hash['permissions']['local_cluster'] = []
@clusters.each { |c|
- c_hash = ActiveSupport::OrderedHash.new
+ c_hash = 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 = ActiveSupport::OrderedHash.new
+ new_hash = 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 = ActiveSupport::OrderedHash.new
+ out_hash = 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 038a1c9..68d2e7e 100644
--- a/pcsd/pcs.rb
+++ b/pcsd/pcs.rb
@@ -2111,22 +2111,11 @@ 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 = ['/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
+ cmd = ['chkconfig', service]
end
+ _, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
+ return (retcode == 0)
end
def is_service_running?(service)
@@ -2141,13 +2130,12 @@ end
def is_service_installed?(service)
unless ISSYSTEMCTL
- cmd = ['/sbin/insserv', '-s']
- stdout, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
+ stdout, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), 'chkconfig')
if retcode != 0
return nil
end
stdout.each { |line|
- if line.split(':')[3] == service
+ if line.split(' ')[0] == service
return true
end
}
@@ -2177,7 +2165,7 @@ def enable_service(service)
cmd = ['systemctl', 'enable', "#{service}.service"]
else
# fails when the service is not installed
- cmd = ['update-rc.d', service, 'enable']
+ cmd = ['chkconfig', service, 'on']
end
_, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
return (retcode == 0)
@@ -2192,7 +2180,7 @@ def disable_service(service)
if ISSYSTEMCTL
cmd = ['systemctl', 'disable', "#{service}.service"]
else
- cmd = ['update-rc.d', service, 'disable']
+ cmd = ['chkconfig', service, 'off']
end
_, _, retcode = run_cmd(PCSAuth.getSuperuserAuth(), *cmd)
return (retcode == 0)
diff --git a/pcsd/pcsd-cli.rb b/pcsd/pcsd-cli.rb
index fcc818b..3c1d078 100755
--- a/pcsd/pcsd-cli.rb
+++ b/pcsd/pcsd-cli.rb
@@ -4,7 +4,7 @@ require 'rubygems'
require 'etc'
require 'json'
require 'stringio'
-require 'active_support/ordered_hash'
+require 'orderedhash'
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 = ActiveSupport::OrderedHash.new
+ response = 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 9816dde..7601865 100644
--- a/pcsd/permissions.rb
+++ b/pcsd/permissions.rb
@@ -1,4 +1,4 @@
-require 'active_support/ordered_hash'
+require 'orderedhash'
module Permissions
@@ -104,7 +104,7 @@ module Permissions
end
def to_hash()
- perm_hash = ActiveSupport::OrderedHash.new
+ perm_hash = 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 db07f4b..61d03ac 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/pacemaker/pengine"
-CIB_BINARY = '/usr/lib/pacemaker/cib'
+PENGINE = "/usr/lib/DEB_HOST_MULTIARCH/pacemaker/pengine"
+CIB_BINARY = '/usr/lib/DEB_HOST_MULTIARCH/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 b17f87c..eaf2cbf 100644
--- a/pcsd/ssl.rb
+++ b/pcsd/ssl.rb
@@ -1,3 +1,4 @@
+require 'rubygems'
require 'webrick'
require 'webrick/https'
require 'openssl'
diff --git a/pcsd/test/.gitignore b/pcsd/test/.gitignore
new file mode 100644
index 0000000..1944fd6
--- /dev/null
+++ b/pcsd/test/.gitignore
@@ -0,0 +1 @@
+*.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