Insure num_cpus grains is an int on BSD systems, for consistency with Linux.

This commit is contained in:
Joshua Elsasser 2012-07-15 07:37:12 -07:00
parent de41270818
commit c4524819e4

View File

@ -124,6 +124,10 @@ def _bsd_cpudata(osdata):
grains = dict([(k, __salt__['cmd.run'](v)) for k, v in cmds.items()])
grains['cpu_flags'] = []
try:
grains['num_cpus'] = int(grains['num_cpus'])
except Exception:
grains['num_cpus'] = 0
return grains