1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-07 13:41:24 +00:00

fw/target/info: Utilise target properties

Use hostname and hostid target properties instead
of existing calls.
This commit is contained in:
Marc Bonnici 2021-04-07 17:36:12 +01:00
parent c4c0230958
commit c8ea525a00

View File

@ -230,16 +230,15 @@ def get_target_info(target):
info.is_rooted = target.is_rooted info.is_rooted = target.is_rooted
info.kernel_version = target.kernel_version info.kernel_version = target.kernel_version
info.kernel_config = target.config info.kernel_config = target.config
info.hostname = target.hostname
info.hostid = target.hostid
try: try:
info.sched_features = target.read_value('/sys/kernel/debug/sched_features').split() info.sched_features = target.read_value('/sys/kernel/debug/sched_features').split()
except TargetError: except TargetError:
# best effort -- debugfs might not be mounted # best effort -- debugfs might not be mounted
pass pass
hostid_string = target.execute('{} hostid'.format(target.busybox)).strip()
info.hostid = int(hostid_string, 16)
info.hostname = target.execute('{} hostname'.format(target.busybox)).strip()
for i, name in enumerate(target.cpuinfo.cpu_names): for i, name in enumerate(target.cpuinfo.cpu_names):
cpu = CpuInfo() cpu = CpuInfo()
cpu.id = i cpu.id = i