code: def find_device(device=None):
      '''
      Find a device in Zenoss. If device not found, returns None.
  
      Parameters:
          device:         (Optional) Will use the grain 'fqdn' by default
  
      CLI Example:
          salt '*' zenoss.find_device
      '''
  
      data = [{'uid': '/zport/dmd/Devices', 'params': {}, 'limit': None}]
      all_devices = _router_request('DeviceRouter', 'getDevices', data=data)
      for dev in all_devices['devices']:
          if dev['name'] == device:
              # We need to save the has for later operations
              dev['hash'] = all_devices['hash']
              log.info('Found device %s in Zenoss', device)
              return dev
  
      log.info('Unable to find device %s in Zenoss', device)
      return Nonf find_device(device=None):
      '''
      Find a device in Zenoss. If device not found, returns None.
  
      Parameters:
          device:         (Optional) Will use the grain 'fqdn' by default
  
      CLI Example:
          salt '*' zenoss.find_device
      '''
  
      data = [{'uid': '/zport/dmd/Devices', 'params': {}, 'limit': None}]
      all_devices = _router_request('DeviceRouter', 'getDevices', data=data)
      for dev in all_devices['devices']:
          if dev['name'] == device:
              # We need to save the has for later operations
              dev['hash'] = all_devices['hash']
              log.info('Found device %s in Zenoss', device)
              return dev
  
      log.info('Unable to find device %s in Zenoss', device)
      return None
docs: Find a device in Zenoss. If device not found, returns None.
  
      Parameters:
          device:         (Optional) Will use the grain 'fqdn' by default
  
      CLI Example:
          salt '*' zenoss.find_device