def update_service(name, service_map):
    """Get an update from the specified service.

    Arguments:
      name (:py:class:`str`): The name of the service.
      service_map (:py:class:`dict`): A mapping of service names to
        :py:class:`flash.service.core.Service` instances.

    Returns:
      :py:class:`dict`: The updated data.

    """
    if name in service_map:
        service = service_map[name]
        data = service.update()
        if not data:
            logger.warning('no data received for service: %s', name)
        else:
            data['service_name'] = service.service_name
            CACHE[name] = dict(data=data, updated=datetime.now())
    else:
        logger.warning('service not found: %s', name)
    if name in CACHE:
        return add_time(CACHE[name])
    return {}
def update_service ( name , service_map ) : if name in service_map : service = service_map [ name ] data = service . update ( ) if not data : logger . warning ( 'no data received for service: %s' , name ) else : data [ 'service_name' ] = service . service_name CACHE [ name ] = dict ( data = data , updated = datetime . now ( ) ) else : logger . warning ( 'service not found: %s' , name ) if name in CACHE : return add_time ( CACHE [ name ] ) return { }
Get an update from the specified service.

    Arguments:
      name (:py:class:`str`): The name of the service.
      service_map (:py:class:`dict`): A mapping of service names to
        :py:class:`flash.service.core.Service` instances.

    Returns:
      :py:class:`dict`: The updated data.