mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
FreeBSD: Update usage of py-sysctl
py-sysctl now includes the CTLTYPE_NODE type nodes in the list returned by sysctl.filter() on FreeBSD head. It also provides descriptions now. Eliminate the subprocess call to get descriptions, and filter out the nodes so we only deal with values. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #11318
This commit is contained in:
committed by
Brian Behlendorf
parent
e5f732edbb
commit
513c196200
@@ -144,13 +144,14 @@ pretty_print = True
|
||||
|
||||
|
||||
if sys.platform.startswith('freebsd'):
|
||||
# Requires py27-sysctl on FreeBSD
|
||||
# Requires py-sysctl on FreeBSD
|
||||
import sysctl
|
||||
|
||||
def kstat_update():
|
||||
global kstat
|
||||
|
||||
k = sysctl.filter('kstat.zfs.misc.arcstats')
|
||||
k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats')
|
||||
if ctl.type != sysctl.CTLTYPE_NODE]
|
||||
|
||||
if not k:
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user