(self, container_id, force=False)
return False
Delete a container tree, the image layers are untouched
Delete a container tree, the image layers are untouched
Delete a container tree the image layers are untouched
def del_container(self, container_id, force=False):
        """Delete a container tree, the image layers are untouched"""
        container_dir = self.cd_container(container_id)
        if not container_dir:
            return False

        if container_dir in self.get_containers_list(True):
            for name in self.get_container_name(container_id):
                self.del_container_name(name)  # delete aliases links
            if force:
                FileUtil(container_dir).rchmod(stat.S_IWUSR | stat.S_IRUSR,
                                                stat.S_IWUSR | stat.S_IRUSR |
                                                stat.S_IXUSR)
            if FileUtil(container_dir).remove(recursive=True):
                self.cur_containerdir = ""
                return True

        return False
def del_container ( self , container_id , force = False ) : container_dir = self . cd_container ( container_id ) if not container_dir : return False if container_dir in self . get_containers_list ( True ) : for name in self . get_container_name ( container_id ) : self . del_container_name ( name ) # delete aliases links if force : FileUtil ( container_dir ) . rchmod ( stat . S_IWUSR | stat . S_IRUSR , stat . S_IWUSR | stat . S_IRUSR | stat . S_IXUSR ) if FileUtil ( container_dir ) . remove ( recursive = True ) : self . cur_containerdir = "" return True return False