[pkg-nagios-changes] [Git][nagios-team/nagios-plugins-contrib][master] check_libs_ng: use iglob instead of glob
Jan Wagner (@waja)
gitlab at salsa.debian.org
Mon Jul 22 11:35:54 BST 2024
Jan Wagner pushed to branch master at Debian Nagios Maintainer Group / nagios-plugins-contrib
Commits:
9416e7fd by Evgeni Golov at 2024-05-06T14:38:33+00:00
check_libs_ng: use iglob instead of glob
iglob returns an iterrator instead of the full list directly, which
uses less memory as the whole list doesn't need to be stored
- - - - -
1 changed file:
- check_libs_ng/check_libs_ng
Changes:
=====================================
check_libs_ng/check_libs_ng
=====================================
@@ -26,7 +26,7 @@ from __future__ import print_function
import os
import sys
-from glob import glob
+from glob import iglob
import argparse
import logging
@@ -53,7 +53,7 @@ def main():
logging.basicConfig(level=logging.WARNING)
needs_reload = dict()
- for proc in glob('/proc/[0-9]*'): # numbers to avoid e.g. /proc/self
+ for proc in iglob('/proc/[0-9]*'): # numbers to avoid e.g. /proc/self
exe = os.path.join(proc, 'exe')
if os.path.exists(exe):
try:
View it on GitLab: https://salsa.debian.org/nagios-team/nagios-plugins-contrib/-/commit/9416e7fdc71764990b6f5ad702bc5b0a849e0125
--
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/nagios-team/nagios-plugins-contrib/-/commit/9416e7fdc71764990b6f5ad702bc5b0a849e0125
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20240722/d79337fe/attachment-0001.htm>
More information about the pkg-nagios-changes
mailing list