Merge pull request #369 from adriaan42/scheduler-fix-regex
scheduler: fix construction of the process name regex
This commit is contained in:
commit
79584b767f
1 changed files with 3 additions and 2 deletions
|
|
@ -660,8 +660,9 @@ class SchedulerPlugin(base.Plugin):
|
|||
sched = dict([(pid, (cmd, option, scheduler, priority, affinity, regex))
|
||||
for pid, cmd in processes])
|
||||
sched_all.update(sched)
|
||||
regex = str(regex).replace("(", r"\(")
|
||||
regex = regex.replace(")", r"\)")
|
||||
# make any contained regexes non-capturing: replace "(" with "(?:",
|
||||
# unless the "(" is preceded by "\" or followed by "?"
|
||||
regex = re.sub(r"(?<!\\)\((?!\?)", "(?:", str(regex))
|
||||
instance._sched_lookup[regex] = [scheduler, priority, affinity]
|
||||
for pid, (cmd, option, scheduler, priority, affinity, regex) \
|
||||
in sched_all.items():
|
||||
|
|
|
|||
Loading…
Reference in a new issue