Esempio n. 1
0
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")
Esempio n. 2
0
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")
Esempio n. 3
0
def _host_names():
    domains = set()
    status, output = subprocess.getstatusoutput(utils.relpath("kvmhosts.sh"))
    for name in output.splitlines():
        domains.add(name)
    return domains
Esempio n. 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