Skip to content

Commit

Permalink
diagnose: Fix exception with Python 3.8+ versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
liviuchircu committed Sep 19, 2024
1 parent bfffb85 commit 5bff458
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opensipscli/modules/diagnose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 5bff458

Please sign in to comment.