Adding Arch Linux support

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
This commit is contained in:
Jamin W. Collins 2017-01-04 07:15:59 -08:00
parent 28622f88ae
commit 4405e4906e
3 changed files with 18 additions and 1 deletions

View File

@ -14,6 +14,7 @@
# GNU Library Public License for more details.
#
from ceph_detect_init import alpine
from ceph_detect_init import arch
from ceph_detect_init import centos
from ceph_detect_init import debian
from ceph_detect_init import exc
@ -55,6 +56,7 @@ def _get_distro(distro, use_rhceph=False):
distro = _normalized_distro_name(distro)
distributions = {
'alpine': alpine,
'arch': arch,
'debian': debian,
'ubuntu': debian,
'linuxmint': debian,
@ -94,7 +96,7 @@ def platform_information():
"""detect platform information from remote host."""
if platform.system() == 'Linux':
linux_distro = platform.linux_distribution(
supported_dists=platform._supported_dists + ('alpine',))
supported_dists=platform._supported_dists + ('alpine', 'arch'))
logging.debug('platform_information: linux_distribution = ' +
str(linux_distro))
distro, release, codename = linux_distro

View File

@ -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'

View File

@ -24,6 +24,7 @@ import testtools
import ceph_detect_init
from ceph_detect_init import alpine
from ceph_detect_init import arch
from ceph_detect_init import centos
from ceph_detect_init import debian
from ceph_detect_init import exc
@ -43,6 +44,9 @@ class TestCephDetectInit(testtools.TestCase):
def test_alpine(self):
self.assertEqual('openrc', alpine.choose_init())
def test_arch(self):
self.assertEqual('systemd', arch.choose_init())
def test_freebsd(self):
self.assertEqual('bsdrc', freebsd.choose_init())