From d78166f6993e01c868793dbb304a1dbffa69fc74 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 15 Dec 2022 18:41:01 +0100 Subject: [PATCH] Fix compatibility with python 3.7 --- check_ceph_status | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_ceph_status b/check_ceph_status index 693a9ca..c614c78 100755 --- a/check_ceph_status +++ b/check_ceph_status @@ -185,8 +185,8 @@ ceph_cmd.append('status') ceph_cmd.append('--format=json') # exec command -with subprocess.Popen(ceph_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p: - output, err = p.communicate() +p = subprocess.Popen(ceph_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +output, err = p.communicate() if not output: print("UNKNOWN : fail to execute ceph status command")