Fixed memtotal for 64bits NetBSD systems

This commit is contained in:
Emile 'iMil' Heitor 2013-05-11 12:52:17 +02:00
parent 53d2ac059a
commit 9c53137777

View File

@ -298,6 +298,8 @@ def _memdata(osdata):
sysctl = salt.utils.which('sysctl')
if sysctl:
mem = __salt__['cmd.run']('{0} -n hw.physmem'.format(sysctl))
if (osdata['kernel'] == 'NetBSD' and mem.startswith('-')):
mem = __salt__['cmd.run']('{0} -n hw.physmem64'.format(sysctl))
grains['mem_total'] = str(int(mem) / 1024 / 1024)
elif osdata['kernel'] == 'SunOS':
prtconf = '/usr/sbin/prtconf 2>/dev/null'