]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph.in: (py3) use binary stdout
authorSage Weil <sage@redhat.com>
Wed, 11 Dec 2019 16:59:24 +0000 (10:59 -0600)
committerSage Weil <sage@redhat.com>
Thu, 12 Dec 2019 16:21:45 +0000 (10:21 -0600)
This fixes an error like

$ ceph -s -o -
Traceback (most recent call last):
  File "bin/ceph", line 1267, in <module>
    retval = main()
  File "bin/ceph", line 1229, in main
    outf.write(outbuf)
TypeError: write() argument must be str, not bytes

Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph.in

index 3be7f4a672b995761c0159026fa8c0c6c1109b2c..70119d50a04464a2d195b8ab837144017647a662 100755 (executable)
@@ -1111,7 +1111,7 @@ def main():
     if parsed_args.output_file:
         try:
             if parsed_args.output_file == '-':
-                outf = sys.stdout
+                outf = raw_stdout
             else:
                 outf = open(parsed_args.output_file, 'wb')
         except Exception as e: