Commit 89fbc1a1 authored by Jeremy C. Reed's avatar Jeremy C. Reed
Browse files

[master] allow sysinfo to provide some generic output on unknown system

This is for ticket #2128. It was reviewed and discussed on jabber.

This extends SysInfoPOSIX to get the hostname and the load average.
Then as a fallback for unknown systems it uses the SysInfoPOSIX.

(By the way, some information is looked up twice, but this
happened before this patch, but now happens for a couple more things.)
parent 564f4b89
......@@ -162,9 +162,12 @@ class SysInfoPOSIX(SysInfo):
u = os.uname()
self._platform_name = u[0]
self._hostname = u[1]
self._platform_version = u[2]
self._platform_machine = u[4]
self._loadavg = os.getloadavg()
class SysInfoLinux(SysInfoPOSIX):
"""Linux implementation of the SysInfo class.
See the SysInfo class documentation for more information.
......@@ -508,4 +511,4 @@ def SysInfoFromFactory():
elif osname == 'BIND10Testcase':
return SysInfoTestcase()
return SysInfo()
return SysInfoPOSIX()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment