Ticket #2128 (closed enhancement: fixed)
allow sysinfo to provide some generic output on unknown system
| Reported by: | jreed | Owned by: | |
|---|---|---|---|
| Priority: | medium | Milestone: | |
| Component: | Unclassified | Keywords: | |
| Cc: | CVSS Scoring: | ||
| Sensitive: | no | Defect Severity: | N/A |
| Sub-Project: | Core | Feature Depending on Ticket: | |
| Estimated Difficulty: | 3 | Add Hours to Ticket: | 0 |
| Total Hours: | 0 | Internal?: | no |
Description
The following patch will provide some details on an unknown system:
diff --git a/src/lib/python/isc/sysinfo/sysinfo.py b/src/lib/python/isc/sysinfo/sysinfo.py
index ddfd224..add344b 100644
--- a/src/lib/python/isc/sysinfo/sysinfo.py
+++ b/src/lib/python/isc/sysinfo/sysinfo.py
@@ -140,9 +140,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.
@@ -477,4 +480,4 @@ def SysInfoFromFactory():
elif osname == 'BIND10Testcase':
return SysInfoTestcase()
else:
- return SysInfo()
+ return SysInfoPOSIX()
I understand that this may not work on non-Unix but we can handle that later.
Change History
comment:2 Changed 10 months ago by jelte
From what I gather, the problem is that in case we don't have a specific subclass for the OS that it is run on, it shows nothing at all. The proposal is to at least print some info if we can get it (through python's os module).
Note: See
TracTickets for help on using
tickets.

I don't understand what the problem is. Could you be more specific?