(self, cont_path)
return True
Delete container mountpoint
Delete container mountpoint
Delete container mountpoint
def delete(self, cont_path):
        """Delete container mountpoint"""
        if cont_path not in self.mountpoints or not self.container_root:
            return False
        container_root = os.path.realpath(self.container_root)
        mountpoint = container_root + '/' + cont_path
        orig_mpath = container_root + '/' + self.mountpoints[cont_path]
        mountpoint = os.path.normpath(mountpoint)
        orig_mpath = os.path.normpath(orig_mpath)
        while mountpoint != orig_mpath:
            if mountpoint.startswith(container_root):
                if not FileUtil(mountpoint).remove():
                    Msg().err("Error: while deleting:", cont_path)
                    return False
                link_path = self.mountpoints[cont_path].replace('/', '#')
                FileUtil(self.mountpoints_orig_dir + '/' + link_path).remove()
                mountpoint = os.path.dirname(mountpoint)
        del self.mountpoints[cont_path]
        return True
def delete ( self , cont_path ) : if cont_path not in self . mountpoints or not self . container_root : return False container_root = os . path . realpath ( self . container_root ) mountpoint = container_root + '/' + cont_path orig_mpath = container_root + '/' + self . mountpoints [ cont_path ] mountpoint = os . path . normpath ( mountpoint ) orig_mpath = os . path . normpath ( orig_mpath ) while mountpoint != orig_mpath : if mountpoint . startswith ( container_root ) : if not FileUtil ( mountpoint ) . remove ( ) : Msg ( ) . err ( "Error: while deleting:" , cont_path ) return False link_path = self . mountpoints [ cont_path ] . replace ( '/' , '#' ) FileUtil ( self . mountpoints_orig_dir + '/' + link_path ) . remove ( ) mountpoint = os . path . dirname ( mountpoint ) del self . mountpoints [ cont_path ] return True