# Path: teuthology/config.py
# def init_logging():
#     def __init__(self, yaml_path=None):
#     def load(self, conf=None):
#     def update(self, in_dict):
#     def from_dict(cls, in_dict):
#     def to_dict(self):
#     def from_str(cls, in_str):
#     def to_str(self):
#     def get(self, key, default=None):
#     def __str__(self):
#     def __repr__(self):
#     def __getitem__(self, name):
#     def __getattr__(self, name):
#     def __contains__(self, name):
#     def __setattr__(self, name, value):
#     def __delattr__(self, name):
#     def __len__(self):
#     def __iter__(self):
#     def __setitem__(self, name, value):
#     def __delitem__(self, name):
#     def __init__(self, yaml_path=None):
#     def get_ceph_cm_ansible_git_url(self):
#     def get_ceph_qa_suite_git_url(self):
#     def get_ceph_git_url(self):
#     def __init__(self, config_dict=None):
#     def _clean_config(self, config_dict):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __repr__(self):
#     def __str__(self):
# def set_config_attr(obj):
# def _get_config_path():
# class YamlConfig(collections.MutableMapping):
# class TeuthologyConfig(YamlConfig):
# class JobConfig(YamlConfig):
# class FakeNamespace(YamlConfig):
# 
# Path: teuthology/misc.py
# def get_http_log_path(archive_dir, job_id=None):
#     """
#     :param archive_dir: directory to be searched
#     :param job_id: id of job that terminates the name of the log path
#     :returns: http log path
#     """
#     http_base = config.archive_server
#     if not http_base:
#         return None
# 
#     sep = os.path.sep
#     archive_dir = archive_dir.rstrip(sep)
#     archive_subdir = archive_dir.split(sep)[-1]
#     if archive_subdir.endswith(str(job_id)):
#         archive_subdir = archive_dir.split(sep)[-2]
# 
#     if job_id is None:
#         return os.path.join(http_base, archive_subdir, '')
#     return os.path.join(http_base, archive_subdir, str(job_id), '')
# 
# def get_results_url(run_name, job_id=None):
#     """
#     :param run_name: The name of the test run
#     :param job_id: The job_id of the job. Optional.
#     :returns: URL to the run (or job, if job_id is passed) in the results web
#               UI. For example, Inktank uses Pulpito.
#     """
#     if not config.results_ui_server:
#         return None
#     base_url = config.results_ui_server
# 
#     if job_id is None:
#         return os.path.join(base_url, run_name, '')
#     return os.path.join(base_url, run_name, str(job_id), '')


import jinja2
import logging
import os
import sys
import time
import types
import yaml
import sentry_sdk
    import smtplib
from copy import deepcopy
from humanfriendly import format_timespan
from teuthology.config import config as teuth_config
from teuthology.exceptions import ConnectionLostError
from teuthology.job_status import set_status, get_status
from teuthology.misc import get_http_log_path, get_results_url
from teuthology.timer import Timer
            from teuthology.task import interactive
                        from teuthology.task import interactive
        from rocketchat.api import RocketChatAPI
    from email.mime.text import MIMEText
            sync=True,
        )
    else:
        timer = Timer()
    stack = []
    try:
        for taskdict in tasks:
            try:
                ((taskname, config),) = taskdict.items()
            except (ValueError, AttributeError):
                raise RuntimeError('Invalid task definition: %s' % taskdict)
            log.info('Running task %s...', taskname)
            timer.mark('%s enter' % taskname)
            manager = run_one_task(taskname, ctx=ctx, config=config)
            if hasattr(manager, '__enter__'):
                stack.append((taskname, manager))
                manager.__enter__()
    except BaseException as e:
        if isinstance(e, ConnectionLostError):
            # Prevent connection issues being flagged as failures
            set_status(ctx.summary, 'dead')
        else:
            # the status may have been set to dead, leave it as-is if so
            if not ctx.summary.get('status', '') == 'dead':
                set_status(ctx.summary, 'fail')
        if 'failure_reason' not in ctx.summary:
            ctx.summary['failure_reason'] = str(e)
        log.exception('Saw exception from tasks.')

        if teuth_config.sentry_dsn:

# Path: teuthology/config.py
# def init_logging():
#     def __init__(self, yaml_path=None):
#     def load(self, conf=None):
#     def update(self, in_dict):
#     def from_dict(cls, in_dict):
#     def to_dict(self):
#     def from_str(cls, in_str):
#     def to_str(self):
#     def get(self, key, default=None):
#     def __str__(self):
#     def __repr__(self):
#     def __getitem__(self, name):
#     def __getattr__(self, name):
#     def __contains__(self, name):
#     def __setattr__(self, name, value):
#     def __delattr__(self, name):
#     def __len__(self):
#     def __iter__(self):
#     def __setitem__(self, name, value):
#     def __delitem__(self, name):
#     def __init__(self, yaml_path=None):
#     def get_ceph_cm_ansible_git_url(self):
#     def get_ceph_qa_suite_git_url(self):
#     def get_ceph_git_url(self):
#     def __init__(self, config_dict=None):
#     def _clean_config(self, config_dict):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __repr__(self):
#     def __str__(self):
# def set_config_attr(obj):
# def _get_config_path():
# class YamlConfig(collections.MutableMapping):
# class TeuthologyConfig(YamlConfig):
# class JobConfig(YamlConfig):
# class FakeNamespace(YamlConfig):
# 
# Path: teuthology/misc.py
# def get_http_log_path(archive_dir, job_id=None):
#     """
#     :param archive_dir: directory to be searched
#     :param job_id: id of job that terminates the name of the log path
#     :returns: http log path
#     """
#     http_base = config.archive_server
#     if not http_base:
#         return None
# 
#     sep = os.path.sep
#     archive_dir = archive_dir.rstrip(sep)
#     archive_subdir = archive_dir.split(sep)[-1]
#     if archive_subdir.endswith(str(job_id)):
#         archive_subdir = archive_dir.split(sep)[-2]
# 
#     if job_id is None:
#         return os.path.join(http_base, archive_subdir, '')
#     return os.path.join(http_base, archive_subdir, str(job_id), '')
# 
# def get_results_url(run_name, job_id=None):
#     """
#     :param run_name: The name of the test run
#     :param job_id: The job_id of the job. Optional.
#     :returns: URL to the run (or job, if job_id is passed) in the results web
#               UI. For example, Inktank uses Pulpito.
#     """
#     if not config.results_ui_server:
#         return None
#     base_url = config.results_ui_server
# 
#     if job_id is None:
#         return os.path.join(base_url, run_name, '')
#     return os.path.join(base_url, run_name, str(job_id), '')


# Path: teuthology/run_tasks.py
import jinja2
import logging
import os
import sys
import time
import types
import yaml
import sentry_sdk
    import smtplib
from copy import deepcopy
from humanfriendly import format_timespan
from teuthology.config import config as teuth_config
from teuthology.exceptions import ConnectionLostError
from teuthology.job_status import set_status, get_status
from teuthology.misc import get_http_log_path, get_results_url
from teuthology.timer import Timer
            from teuthology.task import interactive
                        from teuthology.task import interactive
        from rocketchat.api import RocketChatAPI
    from email.mime.text import MIMEText

            sync=True,
        )
    else:
        timer = Timer()
    stack = []
    try:
        for taskdict in tasks:
            try:
                ((taskname, config),) = taskdict.items()
            except (ValueError, AttributeError):
                raise RuntimeError('Invalid task definition: %s' % taskdict)
            log.info('Running task %s...', taskname)
            timer.mark('%s enter' % taskname)
            manager = run_one_task(taskname, ctx=ctx, config=config)
            if hasattr(manager, '__enter__'):
                stack.append((taskname, manager))
                manager.__enter__()
    except BaseException as e:
        if isinstance(e, ConnectionLostError):
            # Prevent connection issues being flagged as failures
            set_status(ctx.summary, 'dead')
        else:
            # the status may have been set to dead, leave it as-is if so
            if not ctx.summary.get('status', '') == 'dead':
                set_status(ctx.summary, 'fail')
        if 'failure_reason' not in ctx.summary:
            ctx.summary['failure_reason'] = str(e)
        log.exception('Saw exception from tasks.')

        if teuth_config.sentry_dsn:

            sentry_sdk.init(teuth_config.sentry_dsn)