Saggi Mizrahi has posted comments on this change.
Change subject: make misc.pgrep for general usage ......................................................................
Patch Set 3: Code-Review-1
(1 comment)
.................................................... File vdsm/storage/misc.py Line 1108: pid = os.path.basename(path) Line 1109: yield int(pid) Line 1110: Line 1111: Line 1112: def pgrep(value, field): I think using the existing method in conjunction with http://docs.python.org/2/library/itertools.html#itertools.ifilter would be a lot simpler to use and would solve more a diverse set of problems. Line 1113: """ Line 1114: grep processes whose given field's value matches specified value Line 1115: see man 5 proc '/proc/[pid]/stat' for fields description Line 1116: """