def make_django_maintenance_announcement(rds_provisioner, retries_remaining=3):
    """
    Connect to the database and make a maintenance announcement so that we
    can check that the announcement carries through.
    """
    seed_instance = rds_provisioner.seed_node.boto_instance
    # First need to authorize this ip to connect to the DB
    security_group = seed_instance.security_group
    ip = rds_provisioner.get_ip()
    cidr = ip % "%s/32"
    try:
        security_group.authorize(cidr_ip=cidr)
    except BotoServerError:
        # Authorization might already exist
        pass

    # Using multiprocess to avoid Django database-switching madness
    import pstat.settings as settings
    process_kwargs = {
        'settings': settings,
        'seed_instance': seed_instance,
        'seed_master_password': rds_provisioner.seed_master_password,
    }
    make_announcement_p = Process(
        target=_make_django_maintenance_announcement,
        kwargs=process_kwargs,
    )
    make_announcement_p.start()
    make_announcement_p.join()

    if make_announcement_p.exitcode != 0:
        if retries_remaining > 0:
            logger.warning("Error setting announcement")
            logger.warning("%s retries remaining", retries_remaining)
            return rds_provisioner.make_maintenance_announcement(
                retries_remaining=retries_remaining - 1)
        else:
            logger.critical("Error setting announcement")
            logger.critical("All retries exhausted. Failing.")
            exit(1)

    # Now remove the authorization for this ip
    security_group.revoke(cidr_ip=cidr)
dataset/ETHPy150Open winhamwr/neckbeard/neckbeard/cloud_provisioners/aws/contrib_hooks.py/make_django_maintenance_announcement/swapped operands of `%`