Skip to content

Commit

Permalink
Fix retrieve_cpu_sets() output parsing (#1274)
Browse files Browse the repository at this point in the history
Due to a greedy `*` atom in the regex, this
only gets the last **single** digit of the
available cpusets, so `15` becomes `5`. This
breaks validation of any jails' configured
cpuset property that might be greater than
the last output digit. Changing to a non-greedy
`*?` causes the regex to match all of the
final digits.
  • Loading branch information
overhacked authored Nov 23, 2023
1 parent 5068c36 commit cbf0f60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iocage_lib/ioc_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def retrieve_cpu_sets():
pass
else:
result = re.findall(
r'.*mask:.*(\d+)$',
r'.*mask:.*?(\d+)$',
output.stdout.split('\n')[0]
)
if result:
Expand Down

0 comments on commit cbf0f60

Please sign in to comment.