def _sunos_cpudata():
 grains = {}
 grains['cpu_flags'] = []
 grains['cpuarch'] = __salt__['cmd.run']('isainfo -k')
 psrinfo = '/usr/sbin/psrinfo 2>/dev/null'
 grains['num_cpus'] = len(__salt__['cmd.run'](psrinfo, python_shell=True).splitlines())
 kstat_info = 'kstat -p cpu_info:*:*:brand'
 for line in __salt__['cmd.run'](kstat_info).splitlines():
  match = re.match('(\\w+:\\d+:\\w+\\d+:\\w+)\\s+(.+)', line)
  if match:
   grains['cpu_model'] = match.group(2)
 isainfo = 'isainfo -n -v'
 for line in __salt__['cmd.run'](isainfo).splitlines():
  match = re.match('^\\s+(.+)', line)
  if match:
   cpu_flags = match.group(1).split()
   grains['cpu_flags'].extend(cpu_flags)
 return grains

def _sunos_cpudata ( ) : grains = { } grains [ 'cpu_flags' ] = [ ] grains [ 'cpuarch' ] = __salt__ [ 'cmd.run' ] ( 'isainfo -k' ) psrinfo = '/usr/sbin/psrinfo 2>/dev/null' grains [ 'num_cpus' ] = len ( __salt__ [ 'cmd.run' ] ( psrinfo , python_shell = True ) . splitlines ( ) ) kstat_info = 'kstat -p cpu_info:*:*:brand' for line in __salt__ [ 'cmd.run' ] ( kstat_info ) . splitlines ( ) : match = re . match ( '(\\w+:\\d+:\\w+\\d+:\\w+)\\s+(.+)' , line ) if match : grains [ 'cpu_model' ] = match . group ( 2 ) isainfo = 'isainfo -n -v' for line in __salt__ [ 'cmd.run' ] ( isainfo ) . splitlines ( ) : match = re . match ( '^\\s+(.+)' , line ) if match : cpu_flags = match . group ( 1 ) . split ( ) grains [ 'cpu_flags' ] . extend ( cpu_flags ) return grains
return the cpu information for solaris-like systems .