(self, tag_dir, force)
return True
Remove link to image layer and corresponding layer
        if not being used by other images
Remove link to image layer and corresponding layer
        if not being used by other images
Remove link to image layer and corresponding layer if not being used by other images
def _remove_layers(self, tag_dir, force):
        """Remove link to image layer and corresponding layer
        if not being used by other images
        """
        for fname in os.listdir(tag_dir):
            f_path = tag_dir + '/' + fname  # link to layer
            if os.path.islink(f_path):
                linkname = os.readlink(f_path)
                layer_file = tag_dir + '/' + linkname
                if not FileUtil(f_path).remove() and not force:
                    return False
                if not self._inrepository(os.path.basename(linkname)):
                    # removing actual layers not reference by other repos
                    if not FileUtil(layer_file).remove() and not force:
                        return False
        return True
def _remove_layers ( self , tag_dir , force ) : for fname in os . listdir ( tag_dir ) : f_path = tag_dir + '/' + fname # link to layer if os . path . islink ( f_path ) : linkname = os . readlink ( f_path ) layer_file = tag_dir + '/' + linkname if not FileUtil ( f_path ) . remove ( ) and not force : return False if not self . _inrepository ( os . path . basename ( linkname ) ) : # removing actual layers not reference by other repos if not FileUtil ( layer_file ) . remove ( ) and not force : return False return True