]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-17612] Support oracle linux server 421/head
authorAlexei Margasov <amargasov@naumen.ru>
Mon, 10 Oct 2016 13:52:12 +0000 (18:52 +0500)
committerAlexei Margasov <amargasov@naumen.ru>
Wed, 19 Oct 2016 10:44:54 +0000 (15:44 +0500)
ceph_deploy/hosts/__init__.py
ceph_deploy/hosts/centos/install.py
ceph_deploy/hosts/remotes.py
ceph_deploy/tests/unit/hosts/test_hosts.py

index a5f9fcba91cf74d304bda766fdb302b54a62914c..f5d8541e5ec7417b8fbabc500c5f1cffd656a6dc 100644 (file)
@@ -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'):
index 8eb05a1e6e1abc3908ed73aaa5f69f9ade97c185..d7c6812ed445288e50d28ff36e1e801bda838522 100644 (file)
@@ -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'
index 618e961b67c0cc293b480887c36a695eff12b669..9dd98a0a58b25534a79bdd568e59273c8db7cf5e 100644 (file)
@@ -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(),
index c9d9c63e48880a2b84280b3fca0cd32502b787bb..038902e9c751be1f4a6a06a26e75d06bd3004bcc 100644 (file)
@@ -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')