Skip to content

Commit

Permalink
Insure num_cpus grains is an int on BSD systems, for consistency with…
Browse files Browse the repository at this point in the history
… Linux.
  • Loading branch information
jre committed Jul 15, 2012
1 parent de41270 commit c452481
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions salt/grains/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c452481

Please sign in to comment.