From 2a633b783a0ac8da2812d5e5d3a1ba89cd507912 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 7 Apr 2021 17:23:26 +0100 Subject: [PATCH] target: Expose hostid as target property --- devlib/target.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devlib/target.py b/devlib/target.py index 8a577b1..bd7cd5e 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -135,6 +135,10 @@ class Target(object): def kernel_version(self): return KernelVersion(self.execute('{} uname -r -v'.format(quote(self.busybox))).strip()) + @property + def hostid(self): + return int(self.execute('{} hostid'.format(self.busybox)).strip(), 16) + @property def os_version(self): # pylint: disable=no-self-use return {}