<commit_before>from ceph_deploy.util.wrappers import check_call
from ceph_deploy.hosts import common


def install(distro, logger, version_kind, version, adjust_repos):
    release = distro.release
    machine = distro.sudo_conn.modules.platform.machine()

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

    if distro.codename == 'Mantis':
        distro = 'opensuse12'
    else:
        distro = 'sles-11sp2'

    if adjust_repos:
        check_call(
            distro.sudo_conn,
            logger,
            ['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}/{distro}/'.format(
                version=version,
                distro=distro,
                )
        elif version_kind == 'testing':
            url = 'http://ceph.com/rpm-testing/{distro}'.format(distro=distro)
        elif version_kind == 'dev':
            url = 'http://gitbuilder.ceph.com/ceph-rpm-{distro}{release}-{machine}-basic/ref/{version}/'.format(
                distro=distro,
                release=release.split(".", 1)[0],
                machine=machine,
                version=version,
                )

        check_call(
            distro.sudo_conn,
            logger,
            [
                'rpm',
                '-Uvh',
                '--replacepkgs',
                '--force',
                '--quiet',
                '{url}noarch/ceph-release-1-0.noarch.rpm'.format(
                    url=url,
                    ),
                ]
            )

    check_call(
        distro.sudo_conn,
        logger,
        [
            'zypper',
            '--non-interactive',
            '--quiet',
            'install',
            'ceph',
            ],
        )

    # Check the ceph version
    common.ceph_version(distro.sudo_conn, logger)<commit_msg>suse install now uses remoto<commit_after>from ceph_deploy.lib.remoto import process


def install(distro, version_kind, version, adjust_repos):
    release = distro.release
    machine = distro.machine_type

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

    if distro.codename == 'Mantis':
        distro = 'opensuse12'
    else:
        distro = 'sles-11sp2'

    if adjust_repos:
        process.run(
            distro.conn,
            [
                "su",
                "-c",
                "'rpm --import \"https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc\"'".format(key=key),
            ],
        )

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

        process.run(
            distro.conn,
            [
                'rpm',
                '-Uvh',
                '--replacepkgs',
                '--force',
                '--quiet',
                '{url}noarch/ceph-release-1-0.noarch.rpm'.format(
                    url=url,
                    ),
                ]
            )

    process.run(
        distro.sudo_conn,
        [
            'zypper',
            '--non-interactive',
            '--quiet',
            'install',
            'ceph',
            ],
        )
{'fraction_non_alphanumeric': 0.13739669421487602, 'fraction_numerical': 0.0046487603305785125, 'mean_word_length': 1.3094812164579606, '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': '2342690', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1123, 'n_words': 174}