(self, structure)
return status
Verify the structure of a v1 image repository
Verify the structure of a v1 image repository
Verify the structure of a v1 image repository
def _verify_image_v1(self, structure):
        """Verify the structure of a v1 image repository"""
        Msg().out("Info: finding top layer id", l=Msg.INF)
        top_layer_id = self._find_top_layer_id(structure)
        if not top_layer_id:
            Msg().err("Error: finding top layer id")
            return False
        layers_list = self._sorted_layers(structure, top_layer_id)
        layer = iter(layers_list)
        status = True
        for ancestry_layer in structure["ancestry"]:
            if sys.version_info[0] >= 3:
                verify_layer = next(layer)
            else:
                verify_layer = layer.next()
            if ancestry_layer != verify_layer:
                Msg().err("Error: ancestry and layers do not match",
                          ancestry_layer, verify_layer)
                status = False
                continue
        return status
def _verify_image_v1 ( self , structure ) : Msg ( ) . out ( "Info: finding top layer id" , l = Msg . INF ) top_layer_id = self . _find_top_layer_id ( structure ) if not top_layer_id : Msg ( ) . err ( "Error: finding top layer id" ) return False layers_list = self . _sorted_layers ( structure , top_layer_id ) layer = iter ( layers_list ) status = True for ancestry_layer in structure [ "ancestry" ] : if sys . version_info [ 0 ] >= 3 : verify_layer = next ( layer ) else : verify_layer = layer . next ( ) if ancestry_layer != verify_layer : Msg ( ) . err ( "Error: ancestry and layers do not match" , ancestry_layer , verify_layer ) status = False continue return status