]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph_crush: fix rstrip for python 3
authorBruceforce <markus.greis@gmx.de>
Tue, 19 Mar 2019 17:23:56 +0000 (18:23 +0100)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Tue, 19 Mar 2019 23:57:22 +0000 (23:57 +0000)
Removing bytes literals since rstrip only supports type String or None.

Please backport to stable-3.2

Signed-off-by: Bruceforce <markus.greis@gmx.de>
library/ceph_crush.py

index 1289e9080a23a62c5672815a58d19ca9f0623c3d..77714bb729b44773276647229c22aaba79d959dd 100644 (file)
@@ -145,7 +145,7 @@ def exec_commands(module, cmd_list):
     Creates Ceph commands
     '''
     for cmd in cmd_list:
-        rc, out, err = module.run_command(cmd, encoding=None)
+        rc, out, err = module.run_command(cmd)
     return rc, cmd, out, err
 
 
@@ -193,8 +193,8 @@ def run_module():
         end=str(endd),
         delta=str(delta),
         rc=rc,
-        stdout=out.rstrip(b"\r\n"),
-        stderr=err.rstrip(b"\r\n"),
+        stdout=out.rstrip("\r\n"),
+        stderr=err.rstrip("\r\n"),
         changed=True,
     )