From: Jeremy C. Reed Date: Wed, 6 Feb 2013 15:52:50 +0000 (-0600) Subject: [master] allow sysinfo to provide some generic output on unknown system X-Git-Tag: bind10-1.0.0-rc-release~27^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89fbc1a1f41da33150176d8d0ba83ae8e88a03da;p=thirdparty%2Fkea.git [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.) --- diff --git a/src/lib/python/isc/sysinfo/sysinfo.py b/src/lib/python/isc/sysinfo/sysinfo.py index 771400a846..3a59801a4d 100644 --- a/src/lib/python/isc/sysinfo/sysinfo.py +++ b/src/lib/python/isc/sysinfo/sysinfo.py @@ -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() else: - return SysInfo() + return SysInfoPOSIX()