Exemple #1
0
    get_builder_by_test_id, clean_resources_according_post_behavior,
    clean_sct_runners, search_test_id_in_latest, get_testrun_dir,
    format_timestamp, list_clusters_gke, list_clusters_eks)
from sdcm.utils.jepsen import JepsenResults
from sdcm.monitorstack import (restore_monitoring_stack,
                               get_monitoring_stack_services,
                               kill_running_monitoring_stack_services)
from sdcm.cluster import Setup
from sdcm.utils.log import setup_stdout_logger
from sdcm.utils.prepare_region import AwsRegion
from sdcm.utils.get_username import get_username
from utils.build_system.create_test_release_jobs import JenkinsPipelines

LOGGER = setup_stdout_logger()

click_completion.init()


def sct_option(name, sct_name, **kwargs):
    sct_opt = SCTConfiguration.get_config_option(sct_name)
    multimple_use = kwargs.pop('multiple', False)
    sct_opt.update(kwargs)
    return click.option(name,
                        type=sct_opt['type'],
                        help=sct_opt['help'],
                        multiple=multimple_use)


def install_callback(ctx, _, value):
    if not value or ctx.resilient_parsing:
        return value
Exemple #2
0
"""The entrypoint to all rit commands."""
import os
import glob
import itertools

import click
import click_completion

from rit import constants, dotfiles, mapping

click_completion.init()


@click.group(name="rit")
def rit():
    """Main entrypoint of rit, the dotfile manager."""
    pass


@rit.command()
def inject():
    """Starts the injection of base dotfiles.

    Injection is used to describe linking and copying."""

    mappings = dotfiles.get_all_mappings()

    status_mappings = dotfiles.generate_injection_statuses(mappings)
    injection_statuses_not_ok = [
        ms for ms in status_mappings
        if not mapping.okay_status(ms.injection_status)
Exemple #3
0
        if not file_prefix or filename.startswith(file_prefix):

            file_path = os.path.join(path, filename)
            if os.path.isdir(file_path):
                filename += "/"

            if incomplete.startswith("/"):
                result.append(os.path.join(path, filename))
            else:
                result.append(filename)

    return result


click_completion.init(match_incomplete=complete)


@attr.s
class CliTracker:
    input_filename = attr.ib(default=None)

    @property
    def input_file(self):
        return Path(self.input_filename)

    @input_file.setter
    def input_file(self, new_file):
        self.check_path(new_file)
        self.input_filename = new_file