PKGBUILDs/extra/ceph/01-ceph-detec-init.patch

70 lines
2 KiB
Diff
Raw Normal View History

2017-04-01 01:27:49 +00:00
commit c19cb3cd2756ba830edd92158a2913beaa6e24aa
Author: Sébastien Luttringer <seblu@seblu.net>
Date: Sun Mar 26 16:35:13 2017 +0200
Arch support
diff --git a/src/ceph-detect-init/ceph_detect_init/__init__.py b/src/ceph-detect-init/ceph_detect_init/__init__.py
index a2bcc7cf27..ca2f2d7975 100644
--- a/src/ceph-detect-init/ceph_detect_init/__init__.py
+++ b/src/ceph-detect-init/ceph_detect_init/__init__.py
@@ -13,6 +13,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
+from ceph_detect_init import arch
from ceph_detect_init import centos
from ceph_detect_init import debian
from ceph_detect_init import exc
@@ -21,6 +22,7 @@ from ceph_detect_init import rhel
from ceph_detect_init import suse
import logging
import platform
+import os
def get(use_rhceph=False):
@@ -49,6 +51,7 @@ def _get_distro(distro, use_rhceph=False):
distro = _normalized_distro_name(distro)
distributions = {
+ 'arch': arch,
'debian': debian,
'ubuntu': debian,
'linuxmint': debian,
@@ -75,6 +78,8 @@ def _normalized_distro_name(distro):
return 'suse'
elif distro.startswith('centos'):
return 'centos'
+ elif distro.startswith('arch'):
+ return 'arch'
return distro
@@ -103,6 +108,8 @@ def platform_information():
else:
codename = major
+ elif os.path.exists("/etc/arch-release"):
+ return ("arch", None, "arch")
return (
str(distro).rstrip(),
str(release).rstrip(),
diff --git a/src/ceph-detect-init/ceph_detect_init/arch/__init__.py b/src/ceph-detect-init/ceph_detect_init/arch/__init__.py
new file mode 100644
index 0000000000..425ce50bb2
--- /dev/null
+++ b/src/ceph-detect-init/ceph_detect_init/arch/__init__.py
@@ -0,0 +1,11 @@
+distro = None
+release = None
+codename = None
+
+
+def choose_init():
+ """Select a init system
+
+ Returns the name of a init system (upstart, sysvinit ...).
+ """
+ return 'systemd'