We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0aeb5bc commit 9661c6bCopy full SHA for 9661c6b
devlib/target.py
@@ -167,14 +167,18 @@ def number_of_cpus(self):
167
@property
168
@memoized
169
def number_of_nodes(self):
170
- num_nodes = 0
171
- nodere = re.compile(r'^\./node\d+\s*$')
172
cmd = 'cd /sys/devices/system/node && {busybox} find . -maxdepth 1'.format(busybox=quote(self.busybox))
173
- output = self.execute(cmd, as_root=self.is_rooted)
174
- for entry in output.splitlines():
175
- if nodere.match(entry):
176
- num_nodes += 1
177
- return num_nodes
+ try:
+ output = self.execute(cmd, as_root=self.is_rooted)
+ except TargetStableError:
+ return 1
+ else:
+ nodere = re.compile(r'^\./node\d+\s*$')
+ num_nodes = 0
178
+ for entry in output.splitlines():
179
+ if nodere.match(entry):
180
+ num_nodes += 1
181
+ return num_nodes
182
183
184
0 commit comments