HEX
Server: nginx/1.22.0
System: Linux iZuf6jdxbygmf6cco977lcZ 5.10.84-10.4.al8.x86_64 #1 SMP Tue Apr 12 12:31:07 CST 2022 x86_64
User: root (0)
PHP: 7.4.29
Disabled: passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen
Upload Files
File: //lib/python3.6/site-packages/cloudinit/distros/centos.py
# This file is part of cloud-init. See LICENSE file for license information.

from cloudinit.distros import rhel
from cloudinit import log as logging

LOG = logging.getLogger(__name__)


class Distro(rhel.Distro):
    def __init__(self, name, cfg, path):
        rhel.Distro.__init__(self, name, cfg, path)
        self.cname = 'CentOS'
        self.rpmgpgkey_path = None


    def get_fn_release(self):
        reg = re.compile('%s (Linux )?release (\d+.\d+).*' % self.cname)
        check_files = ('/etc/issue',
                       '/etc/issue.net',
                       '/etc/centos-release',
                       '/etc/redhat-release',
                       '/etc/system-release')
        for fn in check_files:
            if os.path.exists(fn):
                out = reg.findall(util.load_file(fn).strip())
                if out: return out[0][-1]
        return ''

# vi: ts=4 expandtab