code: def grains(**kwargs):
      '''
      Get grains for minion.
  
      .. code-block: bash
  
          salt '*' nxos.cmd grains
      '''
      import __main__ as main  # pylint: disable=unused-import
      if not DEVICE_DETAILS['grains_cache']:
          data = sendline('show version')
          if CONNECTION == 'nxapi':
              data = data[0]
          ret = salt.utils.nxos.system_info(data)
          log.debug(ret)
          DEVICE_DETAILS['grains_cache'].update(ret['nxos'])
      return {'nxos': DEVICE_DETAILS['grains_cache']f grains(**kwargs):
      '''
      Get grains for minion.
  
      .. code-block: bash
  
          salt '*' nxos.cmd grains
      '''
      import __main__ as main  # pylint: disable=unused-import
      if not DEVICE_DETAILS['grains_cache']:
          data = sendline('show version')
          if CONNECTION == 'nxapi':
              data = data[0]
          ret = salt.utils.nxos.system_info(data)
          log.debug(ret)
          DEVICE_DETAILS['grains_cache'].update(ret['nxos'])
      return {'nxos': DEVICE_DETAILS['grains_cache']}
docs: Get grains for minion.
  
      .. code-block: bash
  
          salt '*' nxos.cmd grains