@property
    def active_gen_id(self):
        if self._active_gen_id:
            return self._active_gen_id

        active_nodes = InfrastructureNode.objects.filter(
            deployment_name=self.deployment_name,
            is_active_generation=1)
        if len(active_nodes) == 0:
            return None

        first_active_node = active_nodes[0]
        gen_id = first_active_node.generation_id
        for active_node in active_nodes:
            if active_node.generation_id != gen_id:
                err_str = (
                    "Inconsistent generation ids in simpledb. "
                    "%s:%s and %s:%s both marked active"
                )
                context = (
                    first_active_node.aws_id,
                    first_active_node.generation_id,
                    active_node.aws_id,
                    active_node.generation_id)
                raise Exception(context % err_str)

        self._active_gen_id = gen_id

        return self._active_gen_id
dataset/ETHPy150Open winhamwr/neckbeard/neckbeard/environment_manager.py/Deployment.active_gen_id/swapped operands of `%`