コード例 #1
0
ファイル: utils.py プロジェクト: CiscoSystems/jujucharm-n1k
def log_hook():
    """Log when a hook starts and stops its execution.

    Also log to stdout possible CalledProcessError exceptions raised executing
    the hook.
    """
    script = script_name()
    log(">>> Entering {}".format(script))
    try:
        yield
    except CalledProcessError as err:
        log('Exception caught:')
        log(err.output)
        raise
    finally:
        log("<<< Exiting {}".format(script))
コード例 #2
0
ファイル: utils.py プロジェクト: ChrisMacNaughton/solr-jetty
def log_hook():
    """Log when a hook starts and stops its execution.

    Also log to stdout possible CalledProcessError exceptions raised executing
    the hook.
    """
    script = script_name()
    log(">>> Entering {}".format(script))
    try:
        yield
    except CalledProcessError as err:
        log('Exception caught:')
        log(err.output)
        raise
    finally:
        log("<<< Exiting {}".format(script))
コード例 #3
0
ファイル: helpers.py プロジェクト: mitechie/postgresql-charm
def log_exit():
    log("<-- Exiting {}".format(script_name()))
コード例 #4
0
ファイル: helpers.py プロジェクト: mitechie/postgresql-charm
def log_entry():
    log("--> Entering {}".format(script_name()))
コード例 #5
0
def log_exit():
    log("<-- Exiting {}".format(script_name()))
コード例 #6
0
def log_entry():
    log("--> Entering {}".format(script_name()))