def _smartos_computenode_data():
 if salt.utils.is_proxy():
  return {}
 grains = {}
 grains['computenode_vms_total'] = len(__salt__['cmd.run']('vmadm list -p').split('\n'))
 grains['computenode_vms_running'] = len(__salt__['cmd.run']('vmadm list -p state=running').split('\n'))
 grains['computenode_vms_stopped'] = len(__salt__['cmd.run']('vmadm list -p state=stopped').split('\n'))
 sysinfo = json.loads(__salt__['cmd.run']('sysinfo'))
 grains['computenode_sdc_version'] = sysinfo['SDC Version']
 grains['computenode_vm_capable'] = sysinfo['VM Capable']
 if sysinfo['VM Capable']:
  grains['computenode_vm_hw_virt'] = sysinfo['CPU Virtualization']
 grains['manufacturer'] = sysinfo['Manufacturer']
 grains['productname'] = sysinfo['Product']
 grains['uuid'] = sysinfo['UUID']
 return grains

def _smartos_computenode_data ( ) : if salt . utils . is_proxy ( ) : return { } grains = { } grains [ 'computenode_vms_total' ] = len ( __salt__ [ 'cmd.run' ] ( 'vmadm list -p' ) . split ( '\n' ) ) grains [ 'computenode_vms_running' ] = len ( __salt__ [ 'cmd.run' ] ( 'vmadm list -p state=running' ) . split ( '\n' ) ) grains [ 'computenode_vms_stopped' ] = len ( __salt__ [ 'cmd.run' ] ( 'vmadm list -p state=stopped' ) . split ( '\n' ) ) sysinfo = json . loads ( __salt__ [ 'cmd.run' ] ( 'sysinfo' ) ) grains [ 'computenode_sdc_version' ] = sysinfo [ 'SDC Version' ] grains [ 'computenode_vm_capable' ] = sysinfo [ 'VM Capable' ] if sysinfo [ 'VM Capable' ] : grains [ 'computenode_vm_hw_virt' ] = sysinfo [ 'CPU Virtualization' ] grains [ 'manufacturer' ] = sysinfo [ 'Manufacturer' ] grains [ 'productname' ] = sysinfo [ 'Product' ] grains [ 'uuid' ] = sysinfo [ 'UUID' ] return grains
return useful information from a smartos compute node .