From 4198e9bf5a76e9373f6cb21168a3c32fdf5163cf Mon Sep 17 00:00:00 2001 From: Alexei Margasov Date: Mon, 10 Oct 2016 18:52:12 +0500 Subject: [PATCH] [RM-17612] Support oracle linux server --- ceph_deploy/hosts/__init__.py | 7 +++++-- ceph_deploy/hosts/centos/install.py | 4 ++-- ceph_deploy/hosts/remotes.py | 2 ++ ceph_deploy/tests/unit/hosts/test_hosts.py | 4 ++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ceph_deploy/hosts/__init__.py b/ceph_deploy/hosts/__init__.py index a5f9fcb..f5d8541 100644 --- a/ceph_deploy/hosts/__init__.py +++ b/ceph_deploy/hosts/__init__.py @@ -66,9 +66,9 @@ def get(hostname, module.normalized_name = _normalized_distro_name(distro_name) module.normalized_release = _normalized_release(release) module.distro = module.normalized_name - module.is_el = module.normalized_name in ['redhat', 'centos', 'fedora', 'scientific'] + module.is_el = module.normalized_name in ['redhat', 'centos', 'fedora', 'scientific', 'oracle'] module.is_rpm = module.normalized_name in ['redhat', 'centos', - 'fedora', 'scientific', 'suse'] + 'fedora', 'scientific', 'suse', 'oracle'] module.is_deb = not module.is_rpm module.release = release module.codename = codename @@ -93,6 +93,7 @@ def _get_distro(distro, fallback=None, use_rhceph=False): 'ubuntu': debian, 'centos': centos, 'scientific': centos, + 'oracle' : centos, 'redhat': centos, 'fedora': fedora, 'suse': suse, @@ -110,6 +111,8 @@ def _normalized_distro_name(distro): return 'redhat' elif distro.startswith(('scientific', 'scientific linux')): return 'scientific' + elif distro.startswith('oracle'): + return 'oracle' elif distro.startswith(('suse', 'opensuse')): return 'suse' elif distro.startswith('centos'): diff --git a/ceph_deploy/hosts/centos/install.py b/ceph_deploy/hosts/centos/install.py index 8eb05a1..d7c6812 100644 --- a/ceph_deploy/hosts/centos/install.py +++ b/ceph_deploy/hosts/centos/install.py @@ -8,7 +8,7 @@ NON_SPLIT_PACKAGES = ['ceph-osd', 'ceph-mon', 'ceph-mds'] def rpm_dist(distro): - if distro.normalized_name in ['redhat', 'centos', 'scientific'] and distro.normalized_release.int_major >= 6: + if distro.normalized_name in ['redhat', 'centos', 'scientific', 'oracle'] and distro.normalized_release.int_major >= 6: return 'el' + distro.normalized_release.major return 'el6' @@ -32,7 +32,7 @@ def repository_url_part(distro): if distro.normalized_release.int_major >= 6: if distro.normalized_name == 'redhat': return 'rhel' + distro.normalized_release.major - if distro.normalized_name in ['centos', 'scientific']: + if distro.normalized_name in ['centos', 'scientific', 'oracle']: return 'el' + distro.normalized_release.major return 'el6' diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index 618e961..9dd98a0 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -31,6 +31,8 @@ def platform_information(_linux_distribution=None): codename = minor else: codename = major + if not codename and 'oracle' in distro.lower(): # this could be an empty string in Oracle linux + codename = 'oracle' return ( str(distro).rstrip(), diff --git a/ceph_deploy/tests/unit/hosts/test_hosts.py b/ceph_deploy/tests/unit/hosts/test_hosts.py index c9d9c63..038902e 100644 --- a/ceph_deploy/tests/unit/hosts/test_hosts.py +++ b/ceph_deploy/tests/unit/hosts/test_hosts.py @@ -389,6 +389,10 @@ class TestGetDistro(object): result = hosts._get_distro('Scientific') assert result.__name__.endswith('centos') + def test_get_oracle(self): + result = hosts._get_distro('Oracle Linux Server') + assert result.__name__.endswith('centos') + def test_get_redhat(self): result = hosts._get_distro('RedHat') assert result.__name__.endswith('centos') -- 2.47.3