Skip to content

Commit b672eaf

Browse files
committed
Support multi-word cpusets
From cpuset(7): > For masks longer than one word, a comma separator is used between > words. Words are displayed in big-endian order, which has the most > significant bit first. The hex digits within a word are also in > big-endian order.
1 parent 36f3e3b commit b672eaf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/ansible/tests/affinity_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ def _get_cpus(self, path='/proc/self/status'):
179179
try:
180180
for line in fp:
181181
if line.startswith('Cpus_allowed'):
182-
return int(line.split()[1], 16)
182+
mask = line.split()[1].replace(',', '')
183+
return int(mask, 16)
183184
finally:
184185
fp.close()
185186

0 commit comments

Comments
 (0)