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