コード例 #1
0
ファイル: log.py プロジェクト: kancowitz/brewtils
def get_logging_config(system_name=None, **kwargs):
    """Retrieve a logging configuration from Beergarden

    Args:
        system_name: Name of the system to load
        **kwargs: Beergarden connection parameters

    Returns:
        dict: The logging configuration for the specified system
    """
    config = brewtils.get_easy_client(**kwargs).get_logging_config(system_name)

    return convert_logging_config(config)
コード例 #2
0
def get_logging_config(system_name=None, **kwargs):
    """Retrieve a logging configuration from Beergarden

    Args:
        system_name: Name of the system to load
        **kwargs: Beergarden connection parameters

    Returns:
        dict: The logging configuration for the specified system
    """
    warnings.warn(
        "This function is deprecated and will be removed in version "
        "4.0, please consider using 'EasyClient.get_logging_config' and "
        "'configure_logging' instead.",
        DeprecationWarning,
        stacklevel=2,
    )

    config = brewtils.get_easy_client(**kwargs).get_logging_config(system_name)

    return convert_logging_config(config)
コード例 #3
0
def get_python_logging_config(bg_host,
                              bg_port,
                              system_name,
                              ca_cert=None,
                              client_cert=None,
                              ssl_enabled=None):
    """DEPRECATED: Get Beergarden's logging configuration

    This method is deprecated - consider using :func:`get_logging_config`

    Args:
        bg_host (str): Beergarden host
        bg_port (int): Beergarden port
        system_name (str): Name of the system
        ca_cert (str): Path to CA certificate file
        client_cert (str): Path to client certificate file
        ssl_enabled (bool): Use SSL when connection to Beergarden

    Returns:
        dict: The logging configuration for the specified system
    """
    warnings.warn(
        "This function is deprecated and will be removed in version "
        "4.0, please consider using 'get_logging_config' instead.",
        DeprecationWarning,
        stacklevel=2,
    )

    client = brewtils.get_easy_client(
        host=bg_host,
        port=bg_port,
        ssl_enabled=ssl_enabled,
        ca_cert=ca_cert,
        client_cert=client_cert,
    )

    logging_config = client.get_logging_config(system_name=system_name)

    return convert_logging_config(logging_config)
コード例 #4
0
ファイル: conftest.py プロジェクト: devopstoday11/beer-garden
def child_easy_client(request):
    request.cls.child_easy_client = get_easy_client(bg_host="localhost",
                                                    bg_port=2347,
                                                    ssl_enabled=False)
    return request.cls.child_easy_client
コード例 #5
0
 def test_get_easy_client(self):
     client = brewtils.get_easy_client(bg_host="bg_host")
     assert isinstance(client, EasyClient) is True
コード例 #6
0
def setup_easy_client(is_child=False, namespace='docker'):
    client = get_easy_client(**get_config(is_child=is_child))
    wait_for_connection(client)
    wait_for_plugins(client, namespace=namespace)

    return client
コード例 #7
0
def setup_easy_client():
    client = get_easy_client(**get_config())
    wait_for_connection(client)
    wait_for_plugins(client)

    return client