--- cloud-init/cloudinit/util.py 2012-10-04 17:31:06.719897000 -0700 +++ util.py 2012-10-04 21:12:04.657751000 -0700 @@ -996,6 +996,9 @@ raise contents = ofh.getvalue() LOG.debug("Read %s bytes from %s", len(contents), fname) + if not quiet: + for line in contents.splitlines(): + LOG.debug(" < %s", line) return contents @@ -1346,7 +1349,7 @@ os.chmod(path, real_mode) -def write_file(filename, content, mode=0644, omode="wb"): +def write_file(filename, content, mode=0644, omode="wb", quiet=False): """ Writes a file with the given content and sets the file mode as specified. Resotres the SELinux context if possible. @@ -1359,6 +1362,9 @@ ensure_dir(os.path.dirname(filename)) LOG.debug("Writing to %s - %s: [%s] %s bytes", filename, omode, mode, len(content)) + if not quiet: + for line in content.splitlines(): + LOG.debug(" > %s", line) with SeLinuxGuard(path=filename): with open(filename, omode) as fh: fh.write(content)