def find_or_create_op_target(self, entity_id, target_type):
        """ Finds an op-target of type L{target_type} that points to
        L{entity_id}. If no targets exist, one will be created.
        """
        aot = BofhdAuthOpTarget(self.db)

        op_targets = [t for t in aot.list(entity_id=entity_id,
                                          target_type=target_type)]

        # No target exists, create one
        if not op_targets:
            aot.populate(entity_id, target_type)
            aot.write_db()
            return aot

        assert len(op_targets) == 1 # This method will never create more than one
        assert op_targets[0]['attr'] is None # ... and never populates attr

        # Target exists, return it
        aot.find(op_targets[0]['op_target_id'])
        return aot