Opened 7 years ago

Closed 7 years ago

#2692 closed enhancement (fixed)

Add support for NetBSD in isc-sysinfo

Reported by: shane Owned by:
Priority: medium Milestone:
Component: sysinfo Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description (last modified by jinmei)

Add support for NetBSD in isc-sysinfo. This is a sub-ticket of #2085.

We already have support for FreeBSD, OpenBSD, and OS X, so hopefully this ticket should not be too tricky. Hopefully.


Change History (4)

comment:1 Changed 7 years ago by shane

  • Milestone New Tasks deleted

comment:2 Changed 7 years ago by jinmei

  • Description modified (diff)

You should mean NetBSD, not OS X, in the description. Since it can be very confusing
I've directly corrected the description.

comment:3 Changed 7 years ago by jreed

NetBSD support appears to be identical to OpenBSD, so here is a patch. I tested on both systems.

diff --git a/src/lib/python/isc/sysinfo/ b/src/lib/python/isc/sysinfo/
index 3a59801..d298a46 100644
--- a/src/lib/python/isc/sysinfo/
+++ b/src/lib/python/isc/sysinfo/
@@ -325,8 +325,8 @@ class SysInfoBSD(SysInfoPOSIX):
         except (subprocess.CalledProcessError, OSError):
             self._net_connections = 'Warning: "netstat -nr" command failed.\n'
-class SysInfoOpenBSD(SysInfoBSD):
-    """OpenBSD implementation of the SysInfo class.
+class SysInfoNetBSD(SysInfoBSD):
+    """NetBSD and OpenBSD implementation of the SysInfo class.
     See the SysInfo class documentation for more information.
     def __init__(self):
@@ -502,8 +502,8 @@ def SysInfoFromFactory():
     osname = platform.system()
     if osname == 'Linux':
         return SysInfoLinux()
-    elif osname == 'OpenBSD':
-        return SysInfoOpenBSD()
+    elif (osname == 'NetBSD') or (osname == 'OpenBSD'):
+        return SysInfoNetBSD()
     elif osname == 'FreeBSD':
         return SysInfoFreeBSD()
     elif osname == 'Darwin':

comment:4 Changed 7 years ago by jreed

  • Resolution set to fixed
  • Status changed from new to closed

commit 4d074c3e7048f8dde151e078bee4967949d3b32e adds this

I didn't add a changelog entry. Probably doesn't matter since no user noticed before and if they do try it will just work now.

Note: See TracTickets for help on using tickets.