Esempio n. 1
0
def save_to_cache(image):
    '''Given an image object, save all layers to the cache'''
    for layer in image.layers:
        if layer.packages or layer.files_analyzed:
            if get_total_notices(layer) == 0:
                # if there are no new notices, we have probably pulled the
                # data from the cache. So load those notices here.
                load_notices_from_cache(layer)
            cache.add_layer(layer)
Esempio n. 2
0
def save_to_cache(image):
    '''Given an image object, save all layers to the cache'''
    for layer in image.layers:
        if layer.packages:
            cache.add_layer(layer)