diff --git a/devlib/target.py b/devlib/target.py index 92c2633..42fac2c 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -168,9 +168,10 @@ class Target(object): @memoized def number_of_nodes(self): num_nodes = 0 - nodere = re.compile(r'^\s*node\d+\s*$') - output = self.execute('ls /sys/devices/system/node', as_root=self.is_rooted) - for entry in output.split(): + nodere = re.compile(r'^\./node\d+\s*$') + cmd = 'cd /sys/devices/system/node && {busybox} find . -maxdepth 1'.format(busybox=quote(self.busybox)) + output = self.execute(cmd, as_root=self.is_rooted) + for entry in output.splitlines(): if nodere.match(entry): num_nodes += 1 return num_nodes