Skip to content
Extraits de code Groupes Projets
Valider b0a8cbdf rédigé par Philippe's avatar Philippe
Parcourir les fichiers

Fix compatibility issues in python 3.5

parent a78a3221
Aucune branche associée trouvée
Étiquettes v0.0.20
Aucune requête de fusion associée trouvée
......@@ -23,8 +23,8 @@ info_cache_file = "/tmp/check_borgmatic_info_cache"
def get_cached_cmd(cmd, cache_file_path, age_max):
if age_max == 0:
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
return result.stdout
(retcode, result) = subprocess.getstatusoutput(cmd)
return result
else:
renew_cache = True
......@@ -37,7 +37,7 @@ def get_cached_cmd(cmd, cache_file_path, age_max):
if renew_cache:
cmd = "%s > %s" % (cmd, cache_file_path)
subprocess.check_output(cmd, shell=True)
(retcode, result) = subprocess.getstatusoutput(cmd)
return open(cache_file_path, "r").read()
......@@ -137,7 +137,7 @@ def main():
% (last_date, args.warning_age, perf_data_string)
)
ret = OK
except:
except Exception as e:
print("UNKNOWN - Unable to retrieve borgmatic information")
ret = UNKNOWN
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter