How to use the distro.lsb_release_attr function in distro

To help you get started, we’ve selected a few distro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nir0s / distro / tests / test_ld.py View on Github external
'pretty_name',
            'version_id',
            'codename',
        ]
        for key in os_release_keys:
            self.assertEqual(distro.os_release_attr(key),
                MODULE_DISTROI.os_release_attr(key))

        lsb_release_keys = [
            'distributor_id',
            'description',
            'release',
            'codename',
        ]
        for key in lsb_release_keys:
            self.assertEqual(distro.lsb_release_attr(key),
                MODULE_DISTROI.lsb_release_attr(key))

        distro_release_keys = [
            'id',
            'name',
            'version_id',
            'codename',
        ]
        for key in distro_release_keys:
            self.assertEqual(distro.distro_release_attr(key),
                MODULE_DISTROI.distro_release_attr(key))
github Submitty / Submitty / .setup / bin / partial_reset.py View on Github external
running_services = []
    for service in services:
        service = service[2:].strip()
        if "submitty_" not in service:
            continue
        if "running" not in service:
            continue
        service = service.split()[0]
        running_services.append(service)
        subprocess.check_call(["systemctl", "stop", service])

    shutil.rmtree('/var/local/submitty', True)
    Path(SUBMITTY_DATA_DIR, 'courses').mkdir(parents=True)

    distro_name = distro.id()
    distro_version = distro.lsb_release_attr('codename')

    # Clean out the log files, but leave the folders intact
    if Path(CURRENT_PATH, "..", "..", ".vagrant").is_dir():
        repo_path = Path(
            SUBMITTY_REPOSITORY,
            '.vagrant',
            distro_name,
            distro_version,
            'logs',
            'submitty'
        )
        data_path = SUBMITTY_DATA_DIR / 'logs'
        if repo_path.exists():
            shutil.rmtree(str(repo_path))
        repo_path.mkdir()
        data_path.symlink_to(repo_path)
github TinkoffCreditSystems / Nginx-builder / src / config.py View on Github external
import distro
import platform


# Параметры системы
OS_RELEASE = distro.lsb_release_attr('codename')
PLATFORM_ARCH = platform.machine()
OS_DISTRIBUTION = distro.lsb_release_attr('distributor_id').lower()
OS_VERSION = distro.lsb_release_attr('release')[0]

# Адрес загрузки исходного кода nginx
NGINX_URL = "http://nginx.org/download"
NGINX_SRPM_URL_MAINLINE = "http://nginx.org/packages/mainline/centos/{}/SRPMS".format(OS_VERSION)
NGINX_SRPM_URL_STABLE = "http://nginx.org/packages/centos/{}/SRPMS".format(OS_VERSION)

# Архив со скриптами для создания пакета
DEB_PACKAGE_SCRIPTS_URL_MAINLINE = "http://nginx.org/packages/mainline/{}/pool/nginx/n/nginx".format(OS_DISTRIBUTION)
DEB_PACKAGE_SCRIPTS_URL_STABLE = "http://nginx.org/packages/{}/pool/nginx/n/nginx".format(OS_DISTRIBUTION)

# Путь до директории сборки пакета
SRC_PATH = "/usr/src/nginx"

# Error build code
DPKG_FAIL_EXIT_CODE = 29
github TinkoffCreditSystems / Nginx-builder / src / config.py View on Github external
import distro
import platform


# Параметры системы
OS_RELEASE = distro.lsb_release_attr('codename')
PLATFORM_ARCH = platform.machine()
OS_DISTRIBUTION = distro.lsb_release_attr('distributor_id').lower()
OS_VERSION = distro.lsb_release_attr('release')[0]

# Адрес загрузки исходного кода nginx
NGINX_URL = "http://nginx.org/download"
NGINX_SRPM_URL_MAINLINE = "http://nginx.org/packages/mainline/centos/{}/SRPMS".format(OS_VERSION)
NGINX_SRPM_URL_STABLE = "http://nginx.org/packages/centos/{}/SRPMS".format(OS_VERSION)

# Архив со скриптами для создания пакета
DEB_PACKAGE_SCRIPTS_URL_MAINLINE = "http://nginx.org/packages/mainline/{}/pool/nginx/n/nginx".format(OS_DISTRIBUTION)
DEB_PACKAGE_SCRIPTS_URL_STABLE = "http://nginx.org/packages/{}/pool/nginx/n/nginx".format(OS_DISTRIBUTION)

# Путь до директории сборки пакета
SRC_PATH = "/usr/src/nginx"

# Error build code
DPKG_FAIL_EXIT_CODE = 29
github TinkoffCreditSystems / Nginx-builder / src / config.py View on Github external
import distro
import platform


# Параметры системы
OS_RELEASE = distro.lsb_release_attr('codename')
PLATFORM_ARCH = platform.machine()
OS_DISTRIBUTION = distro.lsb_release_attr('distributor_id').lower()
OS_VERSION = distro.lsb_release_attr('release')[0]

# Адрес загрузки исходного кода nginx
NGINX_URL = "http://nginx.org/download"
NGINX_SRPM_URL_MAINLINE = "http://nginx.org/packages/mainline/centos/{}/SRPMS".format(OS_VERSION)
NGINX_SRPM_URL_STABLE = "http://nginx.org/packages/centos/{}/SRPMS".format(OS_VERSION)

# Архив со скриптами для создания пакета
DEB_PACKAGE_SCRIPTS_URL_MAINLINE = "http://nginx.org/packages/mainline/{}/pool/nginx/n/nginx".format(OS_DISTRIBUTION)
DEB_PACKAGE_SCRIPTS_URL_STABLE = "http://nginx.org/packages/{}/pool/nginx/n/nginx".format(OS_DISTRIBUTION)

# Путь до директории сборки пакета
SRC_PATH = "/usr/src/nginx"