def invalidate(self, old_signature, new_signature, force=False):
        if force:
            with model.Session() as session:
                session.delete()
            return

        self.missing_clouds = []

        # Create set of cloud names that which data is not valid anymore
        old_clouds = set(old_signature.keys())
        invalid_clouds = old_clouds.difference(new_signature.keys())
        for name, signature in new_signature.items():
            if name not in old_signature:
                self.missing_clouds.append(name)
                continue
            if old_signature[name] != signature:
                self.missing_clouds.append(name)
                invalid_clouds.add(name)

        with model.Session() as session:
            for cloud in invalid_clouds:
                session.delete(cloud=cloud)
Remove data related to any cloud that changed signature.
dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/os/discovery/stages.py/DiscoverStage.invalidate