1
0
Fork 0

Merge pull request #99 from olysonek/verify_cpumask

Fix verifying cpumask on systems with more than 32 cores
This commit is contained in:
Jaroslav Škarvada 2018-05-03 11:50:56 +02:00 committed by GitHub
commit c2eb0858d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -490,8 +490,8 @@ class Plugin(object):
def _norm_value(self, value):
v = self._cmd.unquote(str(value))
if re.match(r'\s*(0+,)+[\da-fA-F]*\s*$', v):
return re.sub(r'^\s*(0+,)+', "", v)
if re.match(r'\s*(0+,?)+([\da-fA-F]*,?)*\s*$', v):
return re.sub(r'^\s*(0+,?)+', "", v)
return v
def _verify_value(self, name, new_value, current_value, ignore_missing, device = None):

View file

@ -60,7 +60,7 @@ class SysfsPlugin(base.Plugin):
return re.match(r"^/sys/.*", sysfs_file)
def _read_sysfs(self, sysfs_file):
data = self._cmd.read_file(sysfs_file)
data = self._cmd.read_file(sysfs_file).strip()
if len(data) > 0:
return self._cmd.get_active_option(data, False)
else: