From 5bff458e6be10a7e8308065153ab11347749ddae Mon Sep 17 00:00:00 2001 From: Liviu Chircu Date: Thu, 19 Sep 2024 12:09:50 +0300 Subject: [PATCH] diagnose: Fix exception with Python 3.8+ versions The "psutil._exceptions" has been removed at some point, leading to a CLI exception whenever OpenSIPS performs a down-scale operation, leading to a PIDfile being reported as not found. --- opensipscli/modules/diagnose.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opensipscli/modules/diagnose.py b/opensipscli/modules/diagnose.py index 2807a9c..65de92a 100644 --- a/opensipscli/modules/diagnose.py +++ b/opensipscli/modules/diagnose.py @@ -738,7 +738,7 @@ def diagnose_transport_load(self, transport, pgroups, load, net_wait): if have_psutil: try: tot_cpu += proc['cpumon'].cpu_percent(interval=None) - except psutil._exceptions.NoSuchProcess: + except psutil.NoSuchProcess: """opensips may be restarted in the meantime!""" avg_cpu = round(tot_cpu / len(procs))