Opened 7 years ago

Closed 7 years ago

#2128 closed enhancement (fixed)

allow sysinfo to provide some generic output on unknown system

Reported by: jreed Owned by:
Priority: medium Milestone:
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
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.

Subtickets

Change History (5)

comment:1 Changed 7 years ago by jinmei

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

comment:2 Changed 7 years 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).

comment:3 Changed 7 years ago by shane

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:4 Changed 7 years ago by jreed

commit 89fbc1a1f41da33150176d8d0ba83ae8e88a03da

I didn't make a changelog entry for this since it is still incomplete for unknown systems (see #2085) and this change is minor.

Closing this ticket.

comment:5 Changed 7 years ago by jreed

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.