<commit_before>import argparse
import logging

from . import exc
from .cliutil import priority


log = logging.getLogger(__name__)

def lsb_release():
    import platform
    out = platform.dist()

    try:
        (distro, release, codename) = out
    except ValueError:
        raise RuntimeError('platform.dist() gave invalid output')
    if distro == '':
        raise RuntimeError('platform.dist() gave invalid output')

    return (distro, release, codename)

def install_centos(release, codename, version_kind, version):
    import subprocess

    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    subprocess.check_call(
        args='su -c \'rpm --import https://raw.github.com/ceph/ceph/master/keys/{key}.asc\''.format(key=key),
        shell=True,
        )

    if version_kind == 'stable':
        url = 'http://ceph.com/rpm-{version}/'.format(
        version=version,
        )
    elif version_kind == 'testing':
        url = 'http://ceph.com/rpm-testing/'
    elif version_kind == 'dev':
        url = 'http://gitbuilder.ceph.com/ceph-rpm-centos{release}-{machine}-basic/ref/{version}/'.format(
            release=release.split(".",1)[0],
            machine=platform.machine(),
            version=version,
            )
<commit_msg>install: fix key url for centos<commit_after>import argparse
import logging

from . import exc
from .cliutil import priority


log = logging.getLogger(__name__)

def lsb_release():
    import platform
    out = platform.dist()

    try:
        (distro, release, codename) = out
    except ValueError:
        raise RuntimeError('platform.dist() gave invalid output')
    if distro == '':
        raise RuntimeError('platform.dist() gave invalid output')

    return (distro, release, codename)

def install_centos(release, codename, version_kind, version):
    import subprocess

    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    subprocess.check_call(
        args='su -c \'rpm --import "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"\''.format(key=key),
        shell=True,
        )

    if version_kind == 'stable':
        url = 'http://ceph.com/rpm-{version}/'.format(
        version=version,
        )
    elif version_kind == 'testing':
        url = 'http://ceph.com/rpm-testing/'
    elif version_kind == 'dev':
        url = 'http://gitbuilder.ceph.com/ceph-rpm-centos{release}-{machine}-basic/ref/{version}/'.format(
            release=release.split(".",1)[0],
            machine=platform.machine(),
            version=version,
            )

{'fraction_non_alphanumeric': 0.14247921390778534, 'fraction_numerical': 0.0015117157974300832, 'mean_word_length': 2.577027027027027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6163044', 'n_tokens_mistral': 815, 'n_tokens_neox': 791, 'n_words': 175}