'Removes the host "host" from the active (the old one if
"archive" is set to True) column. "host" must be the host
record as returned by MongoDB.
If "host" has a "scanid" attribute, and if it refers to a scan
that have no more host record after the deletion of "host",
then the scan record is also removed.'

def remove(self, host, archive=False):

    if archive:
        colname_hosts = self.colname_oldhosts
        colname_scans = self.colname_oldscans
    else:
        colname_hosts = self.colname_hosts
        colname_scans = self.colname_scans
    self.db[colname_hosts].remove(spec_or_id=host['_id'])
    for scanid in self.getscanids(host):
        if (self.find_one(colname_hosts, {'scanid': scanid}) is None):
            self.db[colname_scans].remove(spec_or_id=scanid)
