コード例 #1
0
ファイル: post.py プロジェクト: vkartashov/libreswan
def sanitize_output(logger, raw_file, test_directory):
    command = [utils.relpath("sanitizer.sh"), raw_file, test_directory]
    logger.debug("sanitize command: %s", command)
    # Note: It is faster to re-read the file than read the
    # pre-loaded raw console output.
    process = subprocess.Popen(command, stdout=subprocess.PIPE)
    stdout, stderr = process.communicate()
    logger.debug("sanitized output:\n%s", stdout)
    if process.returncode or stderr:
        # any hint of an error
        logger.error("sanitize command '%s' failed; exit code %s; stderr: '%s'", command, process.returncode, stderr)
        return None
    return stdout.decode("utf-8")
コード例 #2
0
ファイル: post.py プロジェクト: shuixi2013/libreswan
def sanitize_output(logger, raw_file, test_directory):
    command = [ utils.relpath("sanitizer.sh"), raw_file, test_directory ]
    logger.debug("sanitize command: %s", command)
    # Note: It is faster to re-read the file than read the
    # pre-loaded raw console output.
    process = subprocess.Popen(command, stdout=subprocess.PIPE)
    stdout, stderr = process.communicate()
    logger.debug("sanitized output:\n%s", stdout)
    if process.returncode or stderr:
        # any hint of an error
        logger.error("sanitize command '%s' failed; exit code %s; stderr: '%s'",
                     command, process.returncode, stderr)
        return None
    return stdout.decode("utf-8")
コード例 #3
0
ファイル: testsuite.py プロジェクト: fatenever/libreswan
def _host_names():
    domains = set()
    status, output = subprocess.getstatusoutput(utils.relpath("kvmhosts.sh"))
    for name in output.splitlines():
        domains.add(name)
    return domains
コード例 #4
0
def domain_names():
    domains = set()
    status, output = subprocess.getstatusoutput(utils.relpath("kvmhosts.sh"))
    for name in output.splitlines():
        domains.add(name)
    return domains