From: Peter Palfrader Date: Tue, 4 Jul 2017 09:39:19 +0000 (+0200) Subject: string stuff for py3 X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=3f3b92742679c0dfdf75794f45ef526a133fdc90;p=mirror%2Fdsa-puppet.git string stuff for py3 --- diff --git a/modules/bacula/files/volume-purge-action b/modules/bacula/files/volume-purge-action index 29fe6c6e0..fc6eef7d0 100755 --- a/modules/bacula/files/volume-purge-action +++ b/modules/bacula/files/volume-purge-action @@ -75,8 +75,12 @@ if p.returncode != 0: raise Exception("bconsole failed. stdout:\n%s\nstderr:%s\n"%(out, err)) if args.verbose: - print("stdout:\n%s"%(out,)) + print("stdout:\n") + sys.stdout.buffer.write(out) + print("\n") -if err != "": - print("bconsole said on stderr:\n%s\n"%(err,), file=sys.stderr) +if err != b"": + print("bconsole said on stderr:\n", file=sys.stderr) + sys.stderr.buffer.write(out) + print("", file=sys.stderr) sys.exit(1)